Cycle Chrome windows depending on its Google account

Mac OS X

Cmd-` cycles through windows of the same application. It comes in handy sometimes, but it tends to get in the way when I’m using Chrome and have 8+ windows open at once.

Goal

I’d like to do something similar for switching windows, only with the signed in google account.

Example Usage

  • 2 Chrome windows are open, signed into my personal google account.
  • 2 more windows are signed into my work account.
  • If I’m currently focused on a personal window, I want to be able to focus directly on the next personal window, taking the work windows out of the equation.
  • Vice versa for work windows or any other account.

So…

  • Are there any features in Keyboard Maestro that will help me do this?
  • Can I pull any of the google account info using AppleScripts?

Explored Options

  • Activate Window Switcher - this action provides a list of windows for each application. It’s close to what I want to do but not exact. I’d like something that inspects the google account of the window. Also having to read a list of windows slows me down.

Hey Gregory,

Not per se – no – but that doesn't mean you can't build something.

Yes – but what Google account? Gmail or something else?

------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/03/08 18:36
# dMod: 2017/03/08 18:36 
# Appl: Google Chrome
# Task: Get text content from the front page.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Google_Chrome, @Get, @Text, @Content, @Front, @Page, @JavaScript
------------------------------------------------------------------------------

set jsCmdStr to "document.body.parentNode.textContent"

tell application "Google Chrome"
   tell front window
      tell active tab
         set textContent to execute javascript jsCmdStr
      end tell
   end tell
end tell

------------------------------------------------------------------------------

Look at these:

How to Switch to or Open Gmail in Google Chrome

The syntax for Chrome will be different, so this may be of limited value – but it should provide some insight into how that all works.

Open or Refresh a URL in a Tab in Safari

-Chris