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 [ ]

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

local ui_dir = cui.getDir ()

?

macros.new

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

macros.run

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

macros.edit

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"