Toggle Between Window 1 and Window 2 in any Application

Hey Folks,

I use this macro many times per day.

It simply toggles between the front 2 open windows in any application. This sort of thing can be a life-saver if you have limited screen real estate.


Window: Toggle Between Window 1 and Window 2.kmmacros (2.1 KB)


This Mac OSX shortcut will toggle between all open windows of an app:

⌘ `

That's Command Backquote

Hey JM,

I'm not unaware of that one.

That's a serial window switcher rather than a toggle. To get it to manage the two front windows you have to:

A) Press Cmd-`
B) Press Cmd-Shift-`

It's too easy to drive-by the window you're working with, and the keyboard shortcuts are a bit awkward.

I prefer my macro for what it's designed to do.


1 Like


n.p. I was just sharing another option for moving among windows. :smile:
I'm all for each person using what works best for him/herself.

Chris, this is a great macro! :+1:
I agree, sometimes you just want to TOGGLE between two windows, rather than switching through all of your windows.

Do you know of a macro or script that will just TOGGLE between the last two selected Tabs, like Tabs in:

  • Safari
  • Chrome
  • Script Debugger
  • etc


Hey JM,

The problem with that is keeping track of them.

Unless you continuously monitor window title changes, there's no really good way to completely automate this – and I find that sort of monitoring to be too intrusive (usually).

It ought not to be too hard to make macros to keep “bookmarks” of tabs though.

You could “mark” a tab, “mark” another tab, and then move between them.

You could add more than two.

You'd also need a “Clear Marks” macro.

See my Safari » Switch Tabs-Windows macro for a few ideas on how to activate the tabs/windows.


Yep, my thoughts exactly.

Interesting idea. I'll give it some thought.

Thanks. I'll check it out.

Hey there! I just saw this post, I know it's a little dated but this macro I made a while ago addresses your question I believe. While it does use title change triggers to monitor the tab index changes, I've used it for at least a year or so and has worked like a champ and hasn't interfered with any other macros/functionality yet, hope you dig it as well!

Thanks Kevin. Your macro looks very interesting. I'll definitely check it out.

@kevin_funderburg, @ccstone, and all that are interested:

Kevin's macro is working out great, and has saved me many hours of design and development time. I have made some mods to expand its scope and fit my needs. If you are interested, you can follow this at my post here.

Thanks again, Kevin!