How to I get the value of %ExecutingMacro% in a shell script?

In Keyboard Maestro, you can use %ExecutingMacro% to refer to the name of the macro which is doing some action.

I tend to use it whenever I send a notification, for example, so I can track it down more easily later.

However, sometimes I want to use that in a shell script, and I can't figure out how to do it.

I tried the obvious "$KMVAR_ExecutingMacro" but that seems to be empty.

Is there another way?

You need to store the value in a variable, and then use the corresponding KMVAR environment variable.

Oh. I guess I was thinking it was already a variable.

( I get confused sometimes :wink: )

Thanks, I'll try that.