Keyboard Maestro - disabling for Quick Add windows

I’m dipping my toe into Keyboard Maestro, and I’ve run into a stumbling block. I use Alfred religiously, and if Mail is the frontmost app and I engage Alfred, the Mail-specific keyboard shortcuts are still active. Mail still shows as the frontmost window, so I can’t toggle that setting.I tried using a disable/enable command before and after the trigger for Alfred, but I can’t figure out how to next a second trigger (so that KM disables my Mail keyboard shortcuts when the hotkey for Alfred is engaged and then enables the shortcut group when either Escape or Return are pressed, indicating the end of the Alfred session.)

The same thing happens when I activate the quick add window for Things.

It’s a challenge because Alfred doesn’t take focus, so there is no hook to tell Keyboard Maestro to do something when Alfred is triggered. Have you looked at the Keyboard Maestro forum? It’s a great resource. You could change your app-specific folder from “always active” to “always activated and shows palette until:” the hot key (your Alfred trigger) is pressed. The problem would make re-activating it when you switch back to that app. Hopefully it give you a starting point, along with the KM forum:

Off the top of my head…

What if you used your existing Alfred key activation to run a Keyboard Maestro macro, and have that macro activate Alfred? Keyboard Maestro would then effectively “know” that Alfred has been activated and you could address accorsingly within your macro.

Nasty hack, but it might get you a bit further in practical terms.

1 Like

Good idea. If activate Alfred doesn’t work, try simulating the key stroke trigger. I tested it quickly and it seems to work, even if it is a “nasty hack” :wink:

1 Like

Good thoughts, all. Playing around with it more, I figured out a semi-nasty hack…

The first action after the hotkey is to disable the “” group, then “Pause Until Any Conditions Met” using “The key Return is down” or “The key Escape is down”, then "Activate Macro Group “”

So when Mail is the active window, the keystroke that calls Alfred also disables Mail keyboard shortcuts until I either press Return to execute the Alfred command or Escape to dismiss Alfred.

This also works with the Things quick add window, where I’m using Keyboard maestro to get the message URL, paste it into the Things window, cursor back to the top to enter my task, and then upon hitting return, keyboard shortcuts are reactivated.