I tried creating a window switcher for Microsoft Edge after repurposing the code for firefox/chrome found here:
https://github.com/TaranVH/2nd-keyboard/blob/9ee39aaccf9c58df9c4a7c19eb7d12ab5223872c/Almost_All_Windows_Functions.ahk#L570
My current code is as follows:
Code: Select all
; Application Switcher
;Switch MS Edge and cycle through its windows
SetTitleMatchMode, 2
F17::
Process, Exist, msedge.exe
If errorlevel = 0
Run, msedge.exe
else
GroupAdd, selectmsedges, Microsoft Edge ahk_exe msedge.exe
if WinActive("Microsoft Edge ahk_exe msedge.exe")
GroupActivate, selectmsedges, r
else
WinActivate, Microsoft Edge ahk_exe msedge.exe
Return
F16::
Process, Exist, msedge.exe
If errorlevel = 0
Run, msedge.exe
else
GroupAdd, allmsedges, ahk_exe msedge.exe
if WinActive("ahk_exe msedge.exe")
GroupActivate, allmsedges, r
else
WinActivate, ahk_exe msedge.exe
Return
If Microsoft Edge is not open, open it;
If Microsoft Edge is not active, make it active;
If Microsoft Edge is active, switch to a different Microsoft edge window
This does pretty much what I want. However, my problem is that I have used the "Install this site as an app" feature of Microsoft Edge, which creates a new window of a specific site and makes it as if it were an "independent app". This results in F16 cycling through those windows as well, which I do not want (I have tried fixing that problem with the code for F17).
Here is an example of an "independent app" window with Google Calendar: In contrast, a "normal" Microsoft Edge window looks like this: My intention is to have F17 only cycle through the "normal" Microsoft Edge windows. I have noticed that the "normal" windows always have a window title ending in "Microsoft Edge", so I have tried to distinguish them in my F17 function. But unfortunately, when I press F17, it seems to do nothing. Here are the script lines executed when I press F17: Thanks in advance for your help!