How did I live without this?
Ever had a program or job that required pressing six keys every time to accomplish one thing? AutoHotKey is the answer! This well-known free utility lets you sets up “macros” - you hit one key, and it generates all those six key strokes for you. (Mouse clicks are also supported).

Notice though that I didn’t say “easily lets you set up…”. AutoHotKey is incredibly powerful - you can automate anything with it - and unfortunately the documentation is targeted at PhD’s wanting to control nuclear power stations with a Dvorak keyboard and a joystick. So, here is a quick guide for the rest of us!
How It Works
Firstly you download and install the AutoHotKey utility, which runs in the background (you never directly interact with the program, which I found disconcerting at first).
Then you set up AutoHotKey scripts for your macros. These are just text files with some instructions in them. You give these an extension of .ahk, and when you want to run one, you doubleclick on it, AutoHotKey fires it up in the background, and a icon for it appears in your system tray (hovering over it shows the name of the script). You can compile these into .exe’s (see below).
Writing Scripts
Your script starts with you identifying the key(s) and/or mouseclicks that will trigger the macro. Basically you put the name of the key (see the full list of key names here), followed by ”::”. The following would trigger your script whenever you hit the Enter key:
Enter::
To show that the key is hit together with Ctrl, or Alt, Shift, or the Windows key, prefix it with one or more of these symbols:
^ Ctrl
! Alt
+ Shift
# Windows key
Now start a new line (just for clarity, you could put this in one line). Use the Send command to specify what keystrokes/mouseclicks your macro must generate. Here is a simple script, where Control+Alt+S becomes a hotkey to type a signature (ensure that a window such as an editor or draft e-mail message is active before pressing the hotkey). Here all the characters are sent literally except {Enter}, which simulates a press of the Enter key:
^!s::
Send Sincerely,{Enter}John Smith
return
This Send command would be the same as hitting a Control+C followed by an Alt+Tab followed by the string “pasted:” followed by a Control+V:
Send Send ^c!{tab}pasted:^v
Slowing things down
Sometimes sending all your keystrokes one after the other instantly can go too quickly for Windows, especially if one of them is to open a dialogue box, which will take a fraction of a second to come up. In this case, send your keys separately, separated by Sleep commands to put tiny pauses inbetween. This script is triggered by clicking the right mouse button while holding down the Shift key, and generates the keystrokes to open an Insert dialogue box, paste in the contents of the clipboard, tab to the “ok” button, and press Enter:
+LButton::
Send +{Insert}
Sleep 300
Send ^V
Sleep 100
Send {Tab}
Sleep 100
Send {Enter}
return
Compiling scripts into .exe files
To compile a script into a .exe file, simply right-click on the .ahk file in Windows Explorer, and choose the “Compile Script” option in the context menu that appears. You can now put the .exe file in your Startup folder if you choose so that it will automatically start when you fire up Windows.
Happy automating!
This is only a minute fraction of what you can do with AutoHotKey scripts…
See the documentation on the site for more.








