I have a script that closes a program:
Code: Select all
closeWin() {
WinGet,AppName,ProcessName,A
WinGet, active_id, ID, A
WinClose, ahk_id %active_id%
global closedWin := AppName
Return
}
Code: Select all
bringWinBack() {
global closedWin
Run, % closedWin
Return
}
I guess it have something to do with "ahk_exe" which I have to use on other scripts when I want to execlude Visual Studio Code:
Code: Select all
#IfWinNotActive ahk_exe code.exe
Thanks!
My whole code:
Code: Select all
global closedWin := "x"
^k::closeWin()
^+k::bringWinBack()
bringWinBack() {
global closedWin
Run, % closedWin
Return
}
closeWin() {
WinGet,AppName,ProcessName,A
WinGet, active_id, ID, A
WinClose, ahk_id %active_id%
global closedWin := AppName
Return
}