OK - so you want to get the XML for any macro whose name you specify?
I've turned my example macro above into a KM subroutine which takes a single input and returns an output as follows:
- Input: the name of the macro you want to get the XML of
- Output: the XML of the named macro or an empty string if the macro named does not exist.
I've created a test macro for you to try out the subroutine. Here's the test macro:
Test Get Macro XML By Name.kmmacros (2.6 KB)
Click to see macro
And here is the subroutine:
[SUB] Get Macro XML By Name.kmmacros (2.4 KB)
Click to see macro
Download and install both macros and then enable them both. You might also want to assign a hot key trigger to the test macro. After that, edit the test macro and insert the name of the macro whose XML you want to retrieve. Then run the test macro and it will display either the XML of the macro you specified in a window or a blank window if the macro doesn't exist (maybe you mis-spelled its name).
You can get more sophisticated by sending the output of the subroutine to the clipboard or elsewhere and you could use a Prompt for User Input
action to ask the the name of the macro to plug into the subroutine.
That's me for the night now... 