Is there a way to cancel all instances of a macro with a given name, or perhaps all other instances of the macro that is executing? I can find "cancel all other macros" but nothing for more specific macros.
No, there is no fine grained control over canceling macros.
You can manually cancel specific macros in the Cancel submenu in the Keyboard Maestro status menu, but not via any action.
thanks.. I'll have to stick with "cancel all other macros" then
So, reviving this dead thread (hope that's OK) because I think I found a good solution with %ExecutingInstance% in v9:
If All Conditions Met Execute Actions (The Variable "DND_PrevInstance" is Not Empty)
Cancel Specific Macro %Variable%DND_PrevInstance%
End If
Set Variable “DND_PrevInstance” to Text “%ExecutingInstance%”
--DO STUFF
Set Variable “DND_PrevInstance” to Text “”
Hopefully that makes sense? Basically, you check if a variable (that you'll set just afterwards, and clear at the end) is empty. If it is, do nothing, and continue along - set the variable to the currently executing instance. Do some stuff, then clear the variable.
But if you start another instance of the macro, that variable will be full of the previous iterations ExecutingInstance ID, cancel that one, and then continue (setting the variable to it's own ID). Works nicely enough for me, though it's a pretty short macro and I'm not sure if you could get it to wig out if you trigger them very very quicly.