thecrumb

developer | thinker | tinkerer

Lazy Tool - AutoHotKey


I've been in love with the dynamic snippets in CFEclipse but was looking for something that would do something similar in any program. I dug around and found AutoHotKey (Windows only).

From their site: AutoHotkey is a free, open-source utility for Windows. With it, you can:

  • Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.
  • Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
  • Expand abbreviations as you type them. For example, typing "btw" can automatically produce "by the way".

Macros are simple text files which you run and they sit in your taskbar.

This morning I was just updating the CFEclipse Trac wiki and it was a PITA to do all the wiki formatting... in about 2-3 minutes I whipped up a quick macro for the common wiki formats and it made things much easier!

This macro for example just takes whatever text you select and surrounds in a "= =" which in the Trac wiki is a header.

SC03B::
  clipboard =
  send ^c
  clipwait, 1
  If ErrorLevel = 0
  {
    clipboard = === %clipboard% ===
    send ^v
  }
return

( The SC03B is the keymapping for "F1" on my Microsoft keyboard. )

There is a great tutorial at the AutoHotKey site which covers the basics - and then for more advanced functions - check out the forums and these tips.

For another example I also found this thread at Lifehacker on using it with email.