Yes, that did it. I have added some AppleScript to automatically get the Group name and moved your code into the first part so that it assembles an XML ready to be imported. I left my original Import AppleScript unchanged as the generated XML is now good to be imported.
The goal in all this was to have a method that exports the XML text in a method that doesn't need replicating menu commands and doesn't use the System Clipboard and this now does this.
@Nige_S you are a genius. (@DanThomas you are a genius too, of course!)
Here is my final Macro (the AppleScript is in three Actions so that I know what is going on). The Magenta section does the Export - without needing to use the Clipboard. And the Purple section does the Import.
TEST Export and Import Macro via XML - via AppleScript v3.kmmacros (7.8 KB)
