OK, I made a small reproducible script:
Code: Select all
toggleAppExe(class){
DetectHiddenWindows, on
;MsgBox, %class%
IfWinExist ahk_exe %class%
{
IfWinActive ahk_exe %class%
{
WinHide ahk_exe %class%
WinActivate ahk_class Shell_TrayWnd
}
else
{
; MsgBox, showbegin:
WinShow ahk_exe %class%
WinActivate ahk_exe %class%
}
}
DetectHiddenWindows, off
}
;Edge
CapsLock & ]::
toggleAppExe("msedge.exe")
; toggleAppExe("WindowsTerminal.exe")
return
If you uncomment Wt line, and commnet out Edge one, this works perfectly for Wt. But for Edge, it's very unreliable. It works just after starting Edge, but as soon as I open a tab with Gmail and a second tab. It does not work anymore,nothing happens. I move focus around, click stuff, and suddenly it works again...till when it does not.
I have not been able to identify what makes this work or not.
many thanks in advance