My script already has many #IfWinActive lines, and I am currently using #IfWinNotActive on many of my global hotkeys to disable them when I have a certain window active. However, this is not a very clean solution and now I have more than one program I would like to disable my hotkeys for. Currently, I manually suspend and unsuspend my script, but this gets pretty tedious.
I was wondering if there's a way to automatically suspend the script when a certain program is active and unsuspend when the program loses focus.