May 08, 2007
It's been a long time since the last edition of TechBits, so I promise that this one is really good. If you use iTunes, here's how to control iTunes (play/pause, previous/next track) without having to up the iTunes window! Yes, even if you don't have a multimedia keyboard!
- Download and install AutoHotkey. AutoHotkey is a handy-dandy free utility for programming keyboard hotkeys. Don't worry; it takes up very few resources and it's safe!
- Fire up the text editor of your choice and create a text file called AutoHotkey.ahk in My Documents, with the following contents:
- Run/double-click on AutoHotkey.ahk. This will start up AutoHotkey with the script running.
- Copy the Start Menu shortcut to AutoHotkey to the Startup folder in the Start Menu so that AutoHotkey automatically runs on startup. AutoHotkey will automatically open and run AutoHotkey.ahk in My Documents when it runs.
- If you don't want the AutoHotkey system tray icon to be shown, add a new line to the start of AutoHotkey.ahk containing "#NoTrayIcon" (without the quotes).
DetectHiddenWindows, On
#/::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, {SPACE} ; Pause/Play
return
#,::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, ^{LEFT} ; Previous
return
#.::
IfWinExist, ahk_class iTunes
ControlSend, ahk_parent, ^{RIGHT} ; Next
return- Play/Pause: Win + / (slash)
- Previous Track: Win + , (comma)
- Next Track: Win + . (period)
Labels: AutoHotkey, hacks, iTunes, TechBits