KM does not have a call stack, so you will have to build your own using KM Variables. You can pass a parameter in the Execute Macro that is the name of the calling macro.
So, you could do something like this:
- Macro A calls (Execute Macro) Macro B, with a parameter of
%ExecutingMacro%
- Macro B sets a KM Variable “MacroBStatus” to ADD a line using the parameter
- Just before Macro B finishes, it edits MacroBStatus to remove the line with the parameter. (RegEx can easily do this).
- Then any Macro can check the value of MacroBStatus to determine if it is in use. (If it is empty, then it is not in use).
If you are already using the parameter for Execute Macro, then Macro A will have to the edits to MacroBStatus.
If this doesn’t make sense, feel free to ask questions.
Also, you might be interested in the Semaphore Lock action (KM Wiki) that will prevent simultaneous executions of the same macro.