thecrumb

developer | thinker | tinkerer

Developer Toolbox: AutoHotKey - Super Snippets


So I've been working with a bunch of REALLY old code lately and one thing I run into over and over again is queries with no queryparam.

I do have a snippet setup in CFEclipse to insert a queryparam...

But I still have to cut-n-paste the variable, etc. Kind of a pain when doing it over and over again. So I started tinkering with AutoHotKey (my favorite lazy tool) and came up with this:

;-- Wrap selected text in QueryParam (will first strip ' or ") ---
!q::
clipboard =
send ^c
clipwait, 1
If ErrorLevel = 0
StringReplace, clipboard, clipboard, ', , All
{
clipboard = 
send ^v
}
return

So now I simply highlight my variable - hit my key combo (in this case [ALT]+[Q] and my text is copied to the clipboard - stripped of quote marks, wrapped in the queryparam and sent back to the editor!


'Developer Toolbox: QueryParam Scanner' Oracle: Credential Retrieval Failed

More like this...