I thought I'd share my most useful AHK script. It's simple, but is used many times/day. It's most useful with an address bar command thingy like
http://www.yubnub.org. I implement it in Firefox this way:
http://lifehacker.com/395628/integrate-yubnub-into-firefoxs-address-bar-for-faster-searches
You can select any text, press ctrl+capslock and then a command like "gim" for Google image search and hit enter. It also works for opening URL's that are not hyperlinked. just ctrl+caps+enter. (BTW, Firefox will automatically fix urls wrapping multiple lines or with spaces, so don't bother editing those poorly copied urls)
Hope you find this as useful as I do.
Code:
^Capslock::
SetTitleMatchMode, 2
IfWinExist, Mozilla Firefox
{
;oCB := ClipboardAll ;backup clipboard
Send ^c
ClipWait
if ErrorLevel
exit
WinActivate
WinWaitActive
Send ^t
;Sleep 400 ; Use this option if you have a new tab plugin like quick launch that creates a delay
SendInput {Space}^v{Home}
;Sleep 600 ;Wait for clipboard before restoring it
;ClipBoard := oCB ;restore clipboard
}
return
If you have a plugin like Quick launch, there may be a slight delay before Firefox accepts input in the address bar. Comment out the "Sleep 400" command for that. (May need adjusting).
Also, if you don't want your text to stay in the clipboard, uncomment the first and last 2 lines for backing up and restoring the clipboard.
Another tip: If you run 2 copies of Firefox and need a way (for you or AHK) to tell between the 2, use this plugin to change Firefox's window title:
http://www.oxymoronical.com/web/firefox/nightly. If anyone knows how to easily change Firefox's program icon depending on the profile used, let me know.