10 March, 2008

Macro language for Windows -- AutoHotKey

Some colleagues at work have been touting AutoHotKey as a good way to write macros for Windows. I thought, "what do I need to write any macros for?" Well today I finally had a need, and AutoHotKey came through with flying colors. AutoHotKey is an open source macro program for Windows. You can use it to replace keyboard, joystick, and mouse operations; you can even save it as an .exe so you can run your macros on machines that do not have AutoHotKey installed.
I had to update about 50 entries in a database with the same text, but my only interface was through my web browser. I had a list of records in Excel, so using AutoHotKey, I was able to perform my updates in 1/10th of the time. All I did was select the next record and press my keyboard shortcut -- AutoHotKey did the rest. Here's what AutoHotKey did:
  1. Copy the record number from Excel
  2. Go to my web browser and paste the record number in to find the record
  3. Click modify record
  4. Click to another tab
  5. Go to the 5th line and paste in the update text
  6. Save the record
I used the Auto Script Writer with AutoHotKey to create my macros -- I didn't need to know how to program at all to make it work -- it recorded my actions for me. If you have AutoIt Script scripts, it can run those too. AutoHotKey comes with a rich help system, tutorials, and many examples on its website.

If you really want to explore AutoHotKeys potential, it comes pre-installed with many extras including an API and a script to help you write scripts.



This script watches while you edit an AutoHotkey script. When it sees you type a command followed by a comma or space, it displays that command's parameter list to guide you.
Next time you need a windows macro or just want some simple shortcuts, give AutoHotKey a look. I think you will find it powerful, yet easy to use.

1 comment:

Mark said...

Another AHK lover!

ML Watson