I'm brand new to AHK. I am using hotkeys to fire up programs if not running, and bring to the front if they are. Like this:
#o:: IfWinExist Outlook { WinActivate } else { Run %A_ProgramFiles%\Microsoft Office\OFFICE14\OUTLOOK.EXE WinWait Outlook WinActivate } Returnwhich works great. Now I'd like to do the same to a program (IM type called SPARK) that typically starts up and lives minimized in the system tray (lower right) until you click on it. Then when you close it it goes back to just the tray but is still running.
If it's running in the tray, I'd like to open the window and bring it front. If it's already open in a window (not necessarily maximized, just in an open window) then I just want to bring it to the front, and of it's neither I just want to start it because I can set it so it doesn't start minimized in the tray. I've tried the code above and it doesn't seem to work.
Any help would be appreciated.