; Activates the window identified with wintitle if it's active, ; else opens a new one OpenWindow(wintitle, runCommand) { if WinExist(wintitle) WinActivate ; activates the window found above. Sweet. else Run %runCommand% }
"There seems to be a bug with the WinActivate function in AutoHotkey. (http://productivegeek.com/forums/topic/autohotkey-problem-restoring-minimized-window-and-giving-keyboard-focus)