Unexpected KM Behavior in Activate/Hide Apps in Sonoma

I used to use a macro to activate/hide an application by keyboard shortcuts.

For example, the macro in the image:

CleanShot 2023-10-13 at 11.40.19

Before Sonoma, I can hit the shortcut multiple times to activate/hide an app.

After Sonoma, it seems like KM or macOS did not switch the "active state" to the last application after hiding the current application, although the app menu bar did switch back to the name of the last activated app. If I just used this macro to hide an app, I can't activate this app again with this macro if I don't actively click another app to "switch" the active state.

For now, I used the following macro as a workaround, it seems to support my speculation that the problem is the "active state" of the app:

CleanShot 2023-10-13 at 11.54.54

Just to confirm I’m understanding you correctly, when using that action to hide an app, it would recall (or unminimize, unhide, bring to front etc.) whatever the last application was? I’ve never really paid attention to how this one works, though I use it extensively to switch between apps.

For me, on Ventura, all it does is recall or hide the app. When hiding it, whatever app is frontmost and not hidden ends up being the active app. If all other apps are hidden, it just shows the Desktop (Finder), regardless of what app I had been in previously.

For me, on Ventura, all it does is recall or hide the app. When hiding it, whatever app is frontmost and not hidden ends up being the active app. If all other apps are hidden, it just shows the Desktop (Finder), regardless of what app I had been in previously.

Yes, I expect this same behavior as you described. Just that I assume the last active application is usually the one at the front after you hide the current active app, but I guess it is not completely accurate.

To reproduce the problem I had with the original macro, just use the shortcut three times in a row. In Ventura, it activates, hides, and then activates the app. In Sonoma, it activates and hides the app, but won't activate the app again on the third hit (despite the active app name next to the Apple icon is not this hidden app anymore), unless I click somewhere else.

And the original macro now works again somehow, maybe it was something else. If it shows again, I'll come back to this thread :see_no_evil: