How to set availability in specific applications per macro?

Peter (or anybody else),

Why is it (apparently) not possible to set availability in specific applications on a per macro basis? I know availability can be limited by group, but that:

  1. doesn’t fit my mental model of why I would group things together.
  2. means that you can’t get granular control of availability, short of having convoluted folders like:
  • Not Illustrator
  • Not Photoshop
  • Not Keynote
  • Not Illustrator or Photoshop
  • Not Illustrator or Keynote
  • Not Photoshop or Keynote
  • Not Illustrator, Photoshop or Keynote


1 Like

I’ve always liked the model. I use three kinds of settings for my macro groups:

  1. All apps
  2. One specific app
  3. All apps except [X, Y, Z]

I’m having trouble imagining a scenario where the organization scheme above would be needed?

On the rare occasion I do need granular control, I can just begin the macro with an IF-THEN that checks the frontmost app and cancels or continues accordingly. This action could even be made into its own macro and called from other macros as needed.

1 Like

The design is part of Keyboard Maestro’s overall attempt to keep each part of Keyboard Maestro orthogonal to each other part. This design helps keep complexity down while adding facilities.

You can see this attempt across a wide range of components of Keyboard Maestro:

Each component works independently of each other component. Each component has lots of contained elements. So there are lots of different kinds of triggers, but:

  • All triggers exists to provide a way to start a macro,
  • You don’t need to know about trigger B to know how to use trigger A.
  • You don’t need to know about action A to know how to use trigger A.

Also, each component has its own function, and so if you want to know what to use, the answer should be clear. Indeed, the Quick Start makes this explicit:

  • If you want to make changes, use the Editor.
  • If you want anything to work, make sure the Engine is running.
  • If you want to control when a Macro is active, configure the Macro Group.
  • If you want to control when a Macro is executed, configure its Triggers.
  • If you want to control what a Macro does, configure its Actions.

You can extend this further:

  • If you want to work with multiple items, use a For Each action and a Collection.
  • If you want to make a choice, use Conditions.
  • If you want to work with text, use Text Tokens.
  • If you want to work with numbers, use Functions.

Thus the answer to “Why is it not possible to set availability in specific applications on a per macro basis?” is because “If you want to control when a Macro is active, configure the Macro Group.”

Now, obviously things are purely this simple in all cases. There are exceptions. But they are rare and typically serve a very specific purpose. And sometimes this structure leads to more verbose, more explicit, configuration than might otherwise be the sae. But in Keyboard Maestro, I heavily prefer orthogonality over brevity or special cases or duplication of responsibility.

And I think this methodology has server Keyboard Maestro well, allowing a vast expanse of power with a reasonable little expansion in the complexity. The complexity of Keyboard Maestro 7 has increased relatively little since Keyboard Maestro 4 was released, the UI is largely unchanged, the basic behaviour is largely unchanged. But Keyboard Maestro 7 has enormously more power available than version 4 - Keyboard Maestro 4 did not even have variables!

So that is the reasoning, and forms part of the basis of everything I do with Keyboard Maestro.


Thanks for sharing, Peter. I think that’s a great design. :+1:

Thanks for the replies and explanations.

Somewhat embarrassingly I use KM largely (but not exclusively) to do some pretty basic functions. One of these is paste as plain text. The shortcut keys I chose are burnt into my muscle memory. If I begin using a new app which already uses that combination of keys for a function that I want to use then I need to work out what I should do.

That’s the circumstance that my multiple Not X / Not Y / Neither X nor Y) folders scenario comes up in.

Is there a better way to approach this inconvenience?

In that case, you probably want a combination of the two approaches.

You want a macro group that is active everywhere except the applications you do not want to use the Paste as Plain Text functionality, and then you want the single macro within it to include conditionals to work in the various applications. A simple way of doing that in version 7 is to use theSwitch/Case action with the text condition %Application%1%. Then you can easily add extra cases as needed, and default to Remove Styles/Paste.

Of course, for applications you already have a specific macro group for, you could alternatively set up the macro there and add it to the macro group’s exclusions list.

I have an actual case of KM macro I want to use potentially in every textl field including "Keyboard Maestro User Input" and I can't figure out the right setting.

Even the most general setting:

don't works...


Hey Alain,

You're showing a group — not a macro.

Is something like this what you had in mind?

Typed-Trigger.kmmacros (1.6 KB)

It works for me in Keyboard Maestro text fields, Safari's address field, LaunchBar's text field...

If I've misunderstood please be more specific.


Thanks Chris for your answer and to teach me (like many) in actual leaving AppleScript (among other interesting points) on this forum :smile:

Let me give more details about my question.

Suppose your above macro Typed-Trigger.kmmacros be in Test Group with the above general setting.

You also have in this group KM User Input.kmmacros (2.2 KB)

Suppose you trigger this macro typing "zz": please try to type "hey" in input field...

Let me know your result :wink:

Hey Alain,

Aha! Yes. That’s definitely a problem.

I didn’t understand you were trying to enter text into a macro-driven KM dialog.

This is a problem for Peter to address, because it involves the inner workings of KM.


Thanks to do testing.

I forward to Peter… juste in case :wink:

You cannot use Typed String triggers within the Keyboard Maestro Engine application itself (so within any Prompt dialog or the like). It is a weird quirk of the system keyboard monitoring API - it monitors keystrokes in every other application, but not keystrokes in your own application.

I recorded a simple Macro with KM in Photoshop (PS). I want to use a hotkey to activate the stroke menu. I created but I don't see a way to have it activate only when PS is active. There isn't a do-nothing action when working with if-then in KM.39%20PM

Very easy.
Just create a Macro Group that is activated only when Photoshop is frontmost, and put your macro in this Group.


For more info, see Macro Activation .

Also, if you click on the gear icon for the Select Menu action, and deselect Failure Aborts Macro, then the macro will do nothing (and no failure message will appear) if the application (and therefore the menu) is not active.

it's actually not launching at all right now. Not sure why! Can some help?



I figured it out! I had to quit and restart Keyboard Maestro. Now the PS Only Macro works. Thank you to everyone who helped me. I really appreciate this community and hope that I'm not annoying anyone too much. :blush:

Hey Abdallah,

Creating App-Specific Macro Groups should just work, so this is unusual.

If this issue happens again please make sure to report it.