token.name: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Macros:Special Variables:token.name moved to token.name: Moved to main namespace.) |
No edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
The variable ''token.name'' allows programmatic querying and setting of the token's [[ | The variable ''token.name'' allows programmatic querying and setting of the token's [[Introduction to Tokens|Name]] (the first text field in the screenshot of the Edit Token dialog). | ||
[[Image:Edittoken-name-and-label.jpg]] | [[Image:Edittoken-name-and-label.jpg]] | ||
Line 6: | Line 6: | ||
===Getting the Token Name=== | ===Getting the Token Name=== | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:charName=token.name] | [h:charName=token.name] | ||
Token Name: [charName] | Token Name: [charName] | ||
</ | </syntaxhighlight> | ||
Outputs the value of ''token.name''. | Outputs the value of ''token.name''. | ||
===Setting the Token Name=== | ===Setting the Token Name=== | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:token.name = "Marok the Red"] | [h:token.name = "Marok the Red"] | ||
</ | </syntaxhighlight> | ||
Sets the value of ''token.name'' to "Marok the Red." | Sets the value of ''token.name'' to "Marok the Red." | ||
Line 22: | Line 22: | ||
==Related Pages== | ==Related Pages== | ||
* [[ | * [[token.gm_name]] | ||
* [[ | * [[token.label]] | ||
[[Category:Special Variable]] | |||
[[Category:Macro Function]] |
Latest revision as of 23:59, 4 July 2023
The variable token.name allows programmatic querying and setting of the token's Name (the first text field in the screenshot of the Edit Token dialog).
Examples
Getting the Token Name
[h:charName=token.name]
Token Name: [charName]
Outputs the value of token.name.
Setting the Token Name
[h:token.name = "Marok the Red"]
Sets the value of token.name to "Marok the Red."