https://autohotkey.com/board/topic/9254 ... gram-load/
https://autohotkey.com/board/topic/9246 ... tomations/
I will be setting the script up as a shortcut that when run will automatically start a program called "Sonos" and will then stay active and running until I manually close the Sonos program at which point I want the script to automatically exit. There will be much more in the script when it is running but for now I just want to get the basic actions of running the program and auto exiting the script on program closure working.
If it's any use, when I start the Sonos program and use Window Spy I get the following:
Window Title : Sonos
ahk_class : HwndWrapper[WpfDomain;;41dc915b-6457-4f12-89fe-16c5f0f8a80f]
ahk_exe : Sonos.exe
I tried the following:ahk_class : HwndWrapper[WpfDomain;;41dc915b-6457-4f12-89fe-16c5f0f8a80f]
ahk_exe : Sonos.exe
Code: Select all
Run, C:\Program Files (x86)\Sonos\Sonos.exe
WinWait, ahk_exe Sonos.exe
SetTimer,Sonos,100
Sonos:
IfWinNotExist, Sonos
ExitApp
Return