Code: Select all
!+s::
If WinActive("ahk_exe Notepad.exe")
{
Suspend
Sleep 500
Suspend
Return
}
else
Suspend
Return
The problem is, while the first part of the script works (i.e., if Notepad is active the script suspends, then reactivates itself), the second part works for suspending it, but it doesn't reactivate itself if I press again !+s. It just doesn't see the hotkey anymore:
If I use008: if WinActive("ahk_exe Notepad.exe")
010: Suspend
011: Sleep,500 (0.50)
012: Suspend (0.03)
013: Return (10.98)
008: if WinActive("ahk_exe Notepad.exe")
016: Suspend
017: Return (12.70)
[and nothing else appears if I press again !+s]
Code: Select all
!+s::suspend