Returns a Hash object holding any arguments given to the macro when it was run. For example: when using the command Macro.run, or if a Link created with newRunMacroWithMenuPath was clicked.
Imports all code from the macro with the given menu path into the current macro, similar to #include directives from other programming languages. None of the imported code is run, but any custom commands declared in the imported macro using the Define Command keyword are made available to the current macro.
For example, you might write and later import a math macro that defines some utility commands:
Macro.import "Utils:Math"
$thirtyTwo = Exponentiate(2, 5) # assume the imported code defines this command
The menu path must be enclosed in straight double-quote marks and must be a literal string, it cannot be a dynamic expression (eg: a string that includes interpolated variables). This is because the import occurs at macro compilation, and not during run-time. Instead of a full menu path, you may also use just the macro’s name, if it is unambiguous.
If two or more macros define commands with the same name, the most recently imported macro commands replace previous commands.
Macro.run menuPath, [argumentHash] v2.1
Runs the macro with the given menu path as a nested macro. If the optional argumentHash argument is provided, that Hash object is made available to the nested macro via via the command Macro.arguments.
This command returns whatever value was provided by the nested macro’s Return statement.
Previous Chapter Macro Object |
<< index >> |
Next Chapter StatusItem Object |