Macro Scripts

The Macro Script functions are in a structure package named macros. These functions allow you to access and run Macro Scripts. See Defining Macro Scripts for information on creating Macro Scripts. The Macro Script functions are:

macros.load [ <path_name_string> ]

Loads all of the Macro Script definition (.mcr) files in the current UI directory path, or in directory path specified by <path_name_string>. You can get the current UI directory path with the function:

local ui_dir = cui.getDir ()

 

macros.new <name_string> <category_string> <toolTip_string> <buttonText_string> <body_string>

Creates a new Macro Script with the specified name and category. Returns an Integer Macro Script ID value that uniquely identifies the new Macro Script. See Defining Macro Scripts for a description of Macro Script definitions.

 

macros.run <category_string> <name_string>

macros.run <macro_id_integer>

Executes the specified Macro Script. The Macro Script is identified by either its category and name, or by its unique Macro Script ID value.

 

macros.edit <category_string> <name_string>

macros.edit <macro_id_integer>

These methods will open the Macro Script definition (.mcr) file that defines the specified Macro Script in a script Editor window. The Macro Script is identified by either its category and name, or by its unique Macro Script ID value.

 

macros.list()

Lists all installed macroscripts including the macro ID integer, category and source file path.

 

examples:

macros.load "f:/gametools/macros"

macros.edit "objects" "box"

macros.run 132

macros.run "modifiers" "bend"