Introducing autohotkey

1. October 2011 23:22

Often when people look over my shoulder (or are watching a presentation I am giving), they ask how I get my computer to perform specific tasks without ever touching my mouse. I could write on a long-winded post on being the master of your own tools and all that, but the answer is actually quite simple: I use AutoHotkey. Their tagline says it all: Automation. Hotkeys. Scripting.

Using Autohotkey (or AHK for insiders), you can automate virtually anything by sending keypresses and mouse clicks. You can create hotkeys, auto-expanding strings (convertion "burl" into "http://tijmenvdk.nl/" for instance), create an entire GUI if you want to, and easily compile scripts into portable executables.

To give you an idea of the things I do with Autohotkey:

  • Left-control plus right-control to function as Alt+tab
  • Re-map default Windows shortcuts (Windows+F to run Everything instead of Windows Search, Windows+E to run Free Commander instead of Windows Explorer, etc.)
  • Control special keys on a specific keyboard (for instance, F13 to F19 on my Mac keyboards, but also media keys on my laptop)
  • Remap F1 to F2 inside Excel (seriously, how often have you pressed F1 [help] when all you wanted to do is edit a cell [F2]?)
  • Use a shortcut key to paste text without formatting
  • Toggle the active window to always stay on top (or turn it transparent... or both)
  • Use a shortcut to immediately Google the text you have selected
  • Get CTRL+E back in Firefox to activate the search box

The list goes on. Quick example: to do bullet 4, all you need is this:

 

#IfWinActive ahk_class XLMAIN
	f1::Send {f2}
#IfWinActive

 

To turn the active window translucent when you hold CTRL+ALT+spacebar:

 

^!Space::WinSet, Transparent, 125, A
^!Space UP::WinSet, Transparent, OFF, A

 

Comments are closed