Compared with a "main" calling a sub-routine, where the instances are:
Main Inst: FD37EA36-C64D-409D-B287-640BBA37D65B:AAAD6BD1-1830-41F4-A488-6BD236B6ECCC
Sub Inst: FD37EA36-C64D-409D-B287-640BBA37D65B:3E4FB4DE-0F21-4F71-9C0C-B07BE6F8A097
Note the identical values before the :
Playing last night, I found "easy mode" to be:
In the KM Editor
- Add a "Group" action
- In that "Group", add a "Prompt for user input" action
- In the "Group", after the "Prompt", add a "Return" action
- Set the "Prompt" and "Return" actions' fields etc to "obvious" things so you can spot parts in the XML
- Right-click the "Group" and "Copy as XML"
You can then hack around in your favourite text editor to change the XML as needed -- starting by deleting everything before and after the highest-level <dict> (basically deleting the first 4 and last 2 lines of the XML).
Your "new" action (using AS coz I still don't JXA) will then be
set theXML to "your XML from above goes here"
tell application "Keyboard Maestro Engine"
return (do script theXML)
end
...with the action set to "Save to variable" -- you can the use the contents of that variable later in the macro.
Demo:
XML Demo.kmmacros (5.3 KB)
