Thanks, Rob,
If that were indeed a given, I wouldn't have a question, and your renaming approach would work fine. But I'm not convinced that that is the case.
I ran some comparisons using @_jims's Test WhichSpace macro that I used as an example above. The saved text of the Execute AppleScript action (renamed) is simply:
Get DesktopNo from WhichSpace
tell application "System Events"
tell process "WhichSpace"
set DesktopSpaceList to (title of menu bar items of menu bar 1)
end tell
end tell
return item 1 of DesktopSpaceList Save trimmed results without errors to variable “local_DesktopNo”.
For comparison, this is the XML for the same action:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>ActionName</key>
<string>Get DesktopNo from WhichSpace</string>
<key>ActionUID</key>
<integer>15977236</integer>
<key>DisplayKind</key>
<string>Variable</string>
<key>HonourFailureSettings</key>
<true/>
<key>IncludeStdErr</key>
<false/>
<key>IncludedVariables</key>
<array>
<string>9999</string>
</array>
<key>MacroActionType</key>
<string>ExecuteAppleScript</string>
<key>NotifyOnFailure</key>
<false/>
<key>Path</key>
<string></string>
<key>StopOnFailure</key>
<false/>
<key>Text</key>
<string>tell application "System Events"
tell process "WhichSpace"
set DesktopSpaceList to (title of menu bar items of menu bar 1)
end tell
end tell
return item 1 of DesktopSpaceList</string>
<key>TimeOutAbortsMacro</key>
<false/>
<key>TimeOutPeriod</key>
<real>2</real>
<key>TrimResults</key>
<true/>
<key>TrimResultsNew</key>
<true/>
<key>UseText</key>
<true/>
<key>Variable</key>
<string>local_DesktopNo</string>
</dict>
</array>
</plist>
Note that this is a single action, not a whole macro. The AppleScript code itself is the same in both cases and has 179 bytes. With the simple text overhead, that increases to 334 bytes, an overhead of 155 bytes. In contrast, the XML for this one action takes 1194 bytes, an overhead of 1015 bytes for the one action.
I ran a comparison on the whole macro, and to keep it an accurate measure of what I'm trying to do, I put the text description of the macro actions into a Comment and counted the size of the XML of that single Comment action. I could paste the text into the Comment as formatted text (RTF) or as plain text, so I tried it both ways and then tried variations.
The whole macro as XML is 5452 bytes/characters.
The text description of the macro, pasted into a Comment action, as formatted text, has an XML size of 118252 bytes!
The text pasted into a Comment as plain text is 3839 bytes. It seems that the XML still includes an encoded version of formatted text, just with a plain format.
The text pasted into a Set System Clipboard to Plain Text action, an action where the XML actually keeps just the plain text and not a formatted and encoded version, the XML of that replacement is 2169 bytes.
So that makes a saved text version, within the KBM file, less than half the size of the original macro.
Since most macros have many actions devoted to managing variables and performing conditional tests, rather than simply running AppleScript, which have complex XML structures while being described with a single line of text, I have been assuming that the general difference would be at least that big, if not more.
I tried it with the largest macro I have, MultiTimer 1.3 by Rob Griffiths. The XML for that macro is 493399 bytes. The text version, saved in a Set Clipboard to Plain Text action, has an XML size of 17448 bytes. That's 3.5% of the original!