createMacro: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Added version.) |
Verisimilar (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{stub|Examples using the new functionality.}} | |||
{{MacroFunction | {{MacroFunction | ||
|name=createMacro | |name=createMacro | ||
|version=1.3b48 | |version=1.3b48 | ||
|description=Creates a [[macro button]] for the [[ | |description= | ||
Creates a [[macro button]] for the [[Current Token]] and returns the index of the newly created button. | |||
|usage= | |usage= | ||
Line 14: | Line 16: | ||
createMacro(label, command, props, delim) | createMacro(label, command, props, delim) | ||
</source> | </source> | ||
'''Parameters''' | |||
{{param|label|The label for the macro button.}} | |||
{{param|command|The command to run when the macro button is clicked, or the macro is called.}} | |||
{{param|props|A [[String Property List]] or [[JSON object]] containing the properties for the button. | |||
* | ** {{code|autoExec}} - If the macro will be automatically executed when the button is clicked, accepts {{true}} or {{false}}. | ||
** {{code|color}} - The name of the color for the button. | |||
** {{code|fontColor}} - The name of the font color for the button. | |||
** {{code|includeLabel}} - If the label will be output when the button is clicked. Accepts {{true}} or {{false}}. | |||
* color - The name of the color for the button. | ** {{code|group}} - The name of the group that the button belongs to. | ||
* fontColor - The name of the font color for the button. | ** {{code|sortBy}} - The sort by value of the macro button. | ||
* includeLabel - | ** {{code|fontSize}} - The size of the font for the button. | ||
* group - The name of the group that the button | ** {{code|minWidth}} - The minimum width of the buttom.}} | ||
* sortBy - The sort by value of the macro button. | {{param|delim|The delimiter used to separate the values in the [[String Property List]]. Accepts {{code|"json"}} as a value if you want to pass the props as a [[JSON object]]. Defaults to {{code|","}}.}} | ||
* fontSize - The size of the font for the button. | |||
* minWidth - | |||
|example= | |example= | ||
Line 37: | Line 37: | ||
Will create the following buttons on the current token. | Will create the following buttons on the current token. | ||
[[Image:createMacros.png]] | [[Image:createMacros.png]] | ||
|changes= | |||
{{change|1.3b49|Added {{code|json}} delimiter option.}} | |||
}} | }} | ||
[[Category:Metamacro Function]] | [[Category:Metamacro Function]] |
Revision as of 00:54, 23 March 2009
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
This article needs: Examples using the new functionality.
createMacro() Function
• Introduced in version 1.3b48
Creates a macro button for the Current Token and returns the index of the newly created button.
Usage
createMacro(label, command)
createMacro(label, command, props)
createMacro(label, command, props, delim)
Parameters
label
- The label for the macro button.command
- The command to run when the macro button is clicked, or the macro is called.props
- A String Property List or JSON object containing the properties for the button.autoExec
- If the macro will be automatically executed when the button is clicked, acceptstrue
(1
) orfalse
(0
).color
- The name of the color for the button.fontColor
- The name of the font color for the button.includeLabel
- If the label will be output when the button is clicked. Acceptstrue
(1
) orfalse
(0
).group
- The name of the group that the button belongs to.sortBy
- The sort by value of the macro button.fontSize
- The size of the font for the button.minWidth
- The minimum width of the buttom.
delim
- The delimiter used to separate the values in the String Property List. Accepts"json"
as a value if you want to pass the props as a JSON object. Defaults to","
.
Example
[createMacro("Test", "this is a test", "autoExec=true;color=blue", ";") ]
[createMacro("Another Test", "this is a test", "autoExec=true;color=red;fontColor=white", ";") ]
Will create the following buttons on the current token.
Version Changes
- 1.3b49 - Added
json
delimiter option.