My New Favorite Tool - AutoHotKey

posted on 09/13/07 at 09:02:17 pm by Joel Ross

I first saw AutoHotKey on Scott Hanselman's awesome tool list. As a side note, he's updated his list for 2007.

Anyway, I'd looked at AutoHotKey and it looked pretty cool, but I never really had a use for it, until I upgraded to Vista. I use SlickRun, and that's a great launcher tool, so I was all set. And on XP, I had a program that added global hot keys to Windows Media Player (something lacking from WMP in my opinion).

But then I upgraded to Vista - towards the end of last year - and the program I had wasn't Vista compatible. So for the past few months, whenever someone stopped by, I had to Alt-Tab to WMP and pause it with the mouse or the key combo it wanted. It's a pain when using Virtual PC, as you have to use your mouse to get out of the VPC window - you can't just Alt-Tab away from it.

I was able to deal with it because I got a Bluetooth headset that had pause/play functionality right on them, and that solved a lot of my issues. But I don't always use the headphones when listening to podcasts or watching videos, so I was still looking for something.

Enter AutoHotKey. With it, I was able to add play/pause functionality to a global hotkey - the same one I had before. For anyone who's interested, here's my script:

; Ctrl-Alt-1^!1::
SendInput, {Blind}{Media_Play_Pause}
return

; Ctrl

-Alt-4^!4::
SendInput, {Blind}{Media_Next}
return

; Ctrl

-Alt-3^!3::
SendInput, {Blind}{Media_Prev}
return


You can bind to the Window, Alt, Control and Shift keys - or any combo of them. The above uses the Ctrl-Alt combo - which is what I had before. Pretty simple and straight forward, and it accomplishes the task. I'm looking for other useful scripts - There are 1,000s of pre-built scripts for it, plus you can build your own, so there's lots of options. One I did find is to be able to minimize a program to the system tray, called Min2Tray, which works pretty good.

Categories: Software