How Can a Macro Disable Itself?

[I don’t doubt that this has been covered before, but I can’t find it, and in any case it’s probably useful to have it under its own heading.]

Can a macro disable itself after performing its actions without explicitly naming itself in a Disable Macro action? How?

Basically, I have one macro that enables a second. Then, when the second macro is triggered, I want it to do its thing then disable itself (i.e., a “one-shot” macro).

Other than the Disable Macro action, which requires you to select the specific macro, there is no way currently.

I take it the second macro wants to disable the first macro? Because the second macro knows its own name, so that would not be an issue.

The only way to do it would be to use XML and AppleScript “do script” to build the action yourself.