I'm having difficulty writing this because WorkFlowy (a Chrome extension) and Google Chrome have the same ahk_class.
Here is a script I use to cycle through Windows Explorer windows in a similar fashion:
If WinExist("ahk_class CabinetWClass")
{
WinGetClass, CurrentActive, A
WinGet, Instances, Count, ahk_class CabinetWClass
If Instances > 1
WinSet, Bottom,, A
WinActivate, ahk_class CabinetWClass
}
else
Run "C:\Windows\explorer.exe"
return
I tried replacing every instance of "ahk_class Chrome_WidgetWin_1" (the ahk_class for Chrome) with "Google Chrome ahk_class Chrome_WidgetWin_1" but that didn't work for me. I also added SetTitleMatchMode, 2
and even when I just called If WinExist("Google Chrome")
that seemed to return false since it opened a new Chrome window.
Any help would be appreciated. Thanks.