setMacroCommand: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Parameter typo.)
m (Added version.)
Line 2: Line 2:
|name=setMacroCommand
|name=setMacroCommand
|trusted=true
|trusted=true
|version=1.3b48
|description=
|description=
Sets the command that will be run when the [[Token:Macro Button|Macro Button]] is pressed.  Note because of the way the parser interprets values within [] you may have to use the [[Macros:Functions:encode| encode()]] and [[Macros:Functions:decode|decode()]] functions with the string.
Sets the command that will be run when the [[Token:Macro Button|Macro Button]] is pressed.  Note because of the way the parser interprets values within [] you may have to use the [[Macros:Functions:encode| encode()]] and [[Macros:Functions:decode|decode()]] functions with the string.
Line 7: Line 8:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: setMacroCommand(buttonIndex, command)]
setMacroCommand(buttonIndex, command)
</source>
</source>



Revision as of 13:03, 10 March 2009

setMacroCommand() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.3b48
Sets the command that will be run when the Macro Button is pressed. Note because of the way the parser interprets values within [] you may have to use the encode() and decode() functions with the string.

Usage

setMacroCommand(buttonIndex, command)

Examples

[h: setMacroCommand(1, "[macro('Test@Lib:Test'): '']")]