Trigger on activation

when I set a macro to trigger on activation, should that fire every time the app becomes active (ie foregrounded)? I have the following very simple macro, and when it triggers it demos just what I want, but often when I switch to Safari the macro does not trigger and I have to go to the KM menu and ’trigger by name’ or hit ⌃⌥⌘-T. For example, just now I pulled this window out of the tab bar to create a new window, and verified that there were two windows listed in the Window menu. then I switched to Slack, typed a message, and switched back. Still have two windows. :woman_shrugging:t2:

Edit: also, why is the gear in the second action red?

I've rebuilt it and the gear icon isn't red here. See if it works on your system. If not, post your macro and I'll see if it comes up red for me.

Safari Full Screen.kmmacros (28 KB)

Macro screenshot

I added a pause to account for when Safari is first launched.

1 Like

That pause will prevent the ⌘M from firing if Safari is already in full screen mode though.

But the behavior I am seeing has nothing to do with Safari launching, it is just that sometimes, when I switch to Safari the macro does not fire and I have to trigger it manually, which then works. I’ve tried clearing the shortcut ⌘M and selecting the menu item that is bound to instead (basically repeating the first select action and I am seeing the same behavior.

Do I need to pause after Safari activates and before the macro fires off?

Yes, the macro will trigger whenever Safari activates.

Almost certainly, the macro is indeed triggering when Safari activates each and every time, which you can verify by adding a Play Sound action to the start of the macro:


The issue is almost certainly that your actions are not doing what you want them to do. I don't really understand what you expect to happen with Enter Full Screen and then Minimize window. But if the first action fails, that will cancel the macro. And if the actions happen before Safari is ready for them, that may mean Safari ignores them.

But you just put Safari in to Full Screen Mode with the action proceeding it. At the very least this is going to make thins inconsistent, which is probably what you are seeing.

The gear icon is filled in with your system selected color (red for you, blue for me) because it is indicating there are additional options for the action in the menu, above and beyond the normal ones. Specifically options like "Press and Hold" for the keystroke.

1 Like

I think in the mac or safari’s settings I saw an option called “always open in full screen”.
Try that

When clicking a link in something other than Safari, Safari ones a NEW window, and that window is NOT fun screen. the only exception to this is if the current tab group in Safari is the unnamed/unsynced tab group, which is nearly never the tab group Safari is in. On my laptop this is extremely annoying, so I want Safari to go into full screen mode anytime it activates. The ⌘-M can be removed and replaced with a different menu selection and the behavior doesn’t change. [Recall, I said ⌘-M was. custom keybinding, it is not minimizing Safari).

The shortcut I posted USUALLY does this, but sometimes it doesn’t. When it doesn’t, it is not an error in the macro because triggering the macro manually causes it to do exactly what it is supposed to do. (I’ve added play sound actions, three of them with different sounds, so now I just have to wait until the next time the macro fails to do anything).

I do not see an option in Safari to “always open in full screen"

So, since afdding the sounds before each action and after the last option there has not been a single recurrence of the behavior I was seeing, so it seems that confirms it is a timing issue. Going to replace the sounds with pause for condition and see how that goes.

Edit: Pause for condition worked better than a short timed pauses nd was faster as well. Is this a general thing that I shod be doing in KM? I see some workflows demonstrated that are so fast you never see the intervening windows, or is this just a weirdness on my machine?

1 Like