How to loop through Chrome windows while excluding VS Code editor
Posted: 22 Apr 2021, 18:40
Both Chrome and VS Code share ahk_class Chrome_WidgetWin_1. I'd like to loop through my chrome windows without having VS Code windows in the rotation. How do I modify the below script to do that? I know that VS Code has ProcessName Code.exe which is different than all the chrome instances which have chrome.exe; but how do I prevent a VS code window from activating if it's the next window in the loop.
Code: Select all
#g::
{
WinGetClass, ActiveClass, A
WinGet, n_instances, List, ahk_class %ActiveClass%
if (n_instances > 1)
WinActivateBottom, ahk_class %ActiveClass%,,Tabs Outliner,
return
; WinGet, p_name, ProcessName , ahk_class %ActiveClass%
}