This relates to this question.
How can I make an if statement in AutoHotKey which runs if the current application is not explorer.exe
. This it to prevent the script from quitting explorer.exe
, which it originally did (if I was on explorer).
Current script (which doesn't quit anything at all):
Pause::
WinGet,win_pid,PID,ProcessName,A
if (ProcessName != "explorer.exe") {
Run,taskkill /f /pid %win_pid%,,,
return
} else {
return
}
Original script (which successfully quits the last app, including explorer [if that was the last app]):
Pause::
WinGet,win_pid,PID,A
Run,taskkill /f /pid %win_pid%,,,
return