How to Find my Macros inside "Cancel a specific Macro"?

Hello everyone,

I'm trying to insert a macro by searching for them inside the "cancel specific macro" action.

But I can't see any of my macros in there, do I have to just copy paste the name of my macro and insert it into the "cancel specific macro" action? will it work?


I think you are misunderstanding something. You can't cancel a macro by its name because there could be two copies of the same macro running at the same time, right? How would a name tell you which one needs to be cancelled? That wouldn't make sense, would it? Instead, you have to cancel it by its unique number, which I will tell you how to get in a moment.

As you know, a number can be stored in a variable or potentially a token, which is why you see all those variable names in that pull-down menu. That's not a list of macros.

Every running macro has a number associated with it. I've never used it myself, but I think you can get it from this token: %ExecutingInstance%

There may be other ways to get it. I'm afraid I'm new at this part of Keyboard Maestro. But I'm probably mostly right here.[]=executing&s[]=instance

An important clue is the "T" in the box in your image. That means Text. If the box wanted a variable, it would say "V". If the box wanted a macro, it would probably say M, but I don't think M is used anywhere, because Macro names are not used anywhere in KM (I believe.)


Thanks what you are saying makes sense and I never thought of it that way.
I will do some research on how to find the number.

1 Like

No need to do research @RazMastero - just follow this link to the manual page actions:Redirect Control Flow [Keyboard Maestro Wiki] and you’ll see two examples of how to do it.


Thanks, :grin: I am there now.

1 Like

After reading about it in that post I think I figured it out, however, every time I run my macro, the number that executing instance gives me changes every time so I hope that's not a problem and is supposed to be.

The number will be different each time the macro is run.

Just for my understanding - the 2 actions you’ve shown are in 2 different macros aren’t they? The first action (setting the variable) is in the macro you want to be cancelled while the second action is in the other macro that you’d use to cancel the first macro. Is that how you have it arranged?

1 Like

Yes ...
2 different macros...
and I have set it exactly the way you described it.
works perfectly.

1 Like

Perfect :smiley: