Can I edit a macro through a macro?

Hi there,
basically I had the idea to dynamically create macro with a macro. This works quite well by importing an XML via AppleScript, as Peter demonstrated in his post Create Text Expansion From Selection Macro.

However, is is also possible to edit such a macro via a macro once it was created? Is there for example any way to edit the XML of a macro directly? This would be only minor edits like renaming the macro and change a few constants, no major rebuilding of actions.

Is it possible?



Yes. @DanThomas has done this in a number of his macros.

Here are two in particular you might look at:

You will need to be very conversant with JavaScript.

Good luck, and let us know how it goes.

Thank you Michael, interesting!

Unfortunately I am in this case stuck with KM 6 under OS X 10.8.5 and have no JavaScript available to me. Sorry, should have mentioned that!

So my follow up question: Can this functionality only be achieved via JXA script or is there also a way to achieve the same thing via AppleScript? Does anybody know. Unfortunately right now I cannot even open the JXA-Script blocks in KM 6 to analyze their content.