Hi community. We have the following entry in KM Engine scripting dictionary:
doScript method : Execute a macro or action.
doScript text : The name of macro, UID of macro, or plist of action to execute.
[withParameter: text] : A parameter to the macro (in the %TriggerValue% token)
Is it possible to execute a subroutine in a similar way ?
If you set up a simple macro which calls a subroutine, and copy that macro (or the Execute Subroutine action itself) as XML, (KM Editor -> Edit -> Copy As -> Copy As XML
), you will see the kind of XML that would need to be passed to .doScript
.
Things like:
Expand disclosure triangle to view XML source
<?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>ActionUID</key>
<integer>171779</integer>
<key>MacroActionType</key>
<string>ExecuteSubroutine</string>
<key>MacroUID</key>
<string>7BCFB953-5331-4E1A-A4DC-1051F9D7C8CD</string>
<key>Parameters</key>
<array>
<string>%Variable%localJSCode%</string>
</array>
<key>ResultVariable</key>
<string>localResult</string>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
</array>
</plist>
1 Like