1

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.

1 Answer 1

0

Chrome has shortcut keys that you could to switch tabs? Just send the short cuts key instead?

https://support.google.com/chrome/answer/157179?hl=en

You could bind the keys to the mouse wheel to go thru the tabs if yeh wanted?

Main reason this does not work with chrome, is explorer essential opens another explorer for each tab where as chrome just adds another tab to its one program.

the snippet you cut-n-pasted basically

WinGet, Instances, Count, ahk_class CabinetWClass <=== gets the count and dumps it into Instance if Instance greater then one drops the top one to the bottom of the stack

WinActivate, ahk_class CabinetWClass <=== sets the focus to the now top one

There's no "filtering" occurring so no idea what you mean by that

this does something similar

#SingleInstance force
SetTitleMatchMode, 2

If WinExist("Google Chrome")
{
    WinActivate,Google Chrome
    Send, {CTRLDOWN}{TAB}{CTRLUP}
}
else
    Run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
return
1
  • Hm, so my problem isn't with having multiple tabs, at least I believe not. If I select by ahk_class, sometimes it will activate my Chrome window, which is always the tab already open (desired behavior). However, if I was using a Chrome extension such as Hangouts or WorkFlowy, it could activate that extension, instead of the internet browser.
    – user317258
    Jun 15, 2015 at 1:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .