An odd issue with the Activate a Specific Application action and multiple windows temporarily losing window cycling functionality

I regularly manage my work and non-work web browsing in Safari by using two windows. All work related sites are in tabs in window 1, and all non-work sites are in tabs in Window 2. I rapidly switch between the two windows using the native Mac keyboard shortcut of ⌘-`.

I use the Activate a Specific Application action to toggle the visibility of Safari throughout my day. The macro, for your reference:

Previously (at least prior to Sonoma, and prior to Keyboard Maestro 11), the above workflow worked flawlessly, through hundreds of daily uses.

Now, with Sonoma and Keyboard Maestro 11 (also reproducible in 11.0.1), I've found an odd issue with the Activate a Specific Application action when used multiple times (sometimes it takes six or more uses, but it eventually happens). The issue causes the loss of window cycling functionality when using the native Mac keyboard shortcut (meaning that ⌘-` does nothing).

How to reproduce this:

  1. Open two windows in Safari (I've also been able to reproduce this in Apple Mail).
  2. Trigger my Activate a Specific Application macro (as seen in the above screenshot). Do this a number of times (I can reproduce the issue after six, seven, eight or nine triggers, on average).
  3. Try to switch or cycle through Safari's windows, using ⌘-`.
  4. Notice that the windows do not cycle.

After this issue occurs, I am able to get ⌘-` to cycle again, if I use Mission Control, or if I select the non-active window in the Window menu of Safari.

I hope that the above helps you track down and fix the issue (as the intermittent absence of the ⌘-` functionality is frustrating me to no end).

@peternlewis — may I bother you to look at this issue?

I tried this on my Sonoma test Mac with 11.0.1, and could not duplicate the issue.

I used your action, configured as shown, with a hot key trigger, which I pressed dozens of times to activate and then hide Safari (with two empty windows open) and Command-` continued to work.

So I am not sure what to suggest. Maybe other people can see if they can duplicate it. Maybe there is something else going on?

Thanks for trying Peter!

On the chance that I missed something in my write up, here is screen recording, on the chance that it helps you or someone else reproduce the issue, or spot an important part:

Unfortunately, I don't know what to suggest because the Command- is handled by the system. So unless there was some sort of macro being triggered instead of the Command- I'm not sure how it could be affected at that point. Maybe the system loses track of the other windows? I don't really know.

I found some additional information, and have created a macro that works around the issue.

Posting this here, in case this helps someone else.

I was able to reproduce the issue without Keyboard Maestro running (first, using an AppleScript and FastScrpts, and subsequently just using the Finder). So, the issue is unrelated to Keyboard Maestro.

I found this post on Reddit. So the issue is not unique to my system.

This macro works around the issue. Thus far, it cycles through an apps' windows flawlessly, even if the native Mac keyboard shortcut won't:

I hope that helps!