getPropertyNamesRaw: Difference between revisions
m (Conversion script moved page GetPropertyNamesRaw to getPropertyNamesRaw: Converting page titles to lowercase) |
m (Text replacement - "source>" to "syntaxhighlight>") |
||
Line 11: | Line 11: | ||
getPropertyNamesRaw(delim, id) | getPropertyNamesRaw(delim, id) | ||
getPropertyNamesRaw(delim, id, mapname) | getPropertyNamesRaw(delim, id, mapname) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param|delim|The delimiter used to separate the values in the [[String List]], defaults to {{code|","}}. Returns a [[JSON Array]] if set to {{code|"json"}}. }} | {{param|delim|The delimiter used to separate the values in the [[String List]], defaults to {{code|","}}. Returns a [[JSON Array]] if set to {{code|"json"}}. }} | ||
Line 22: | Line 22: | ||
[h: names = getPropertyNamesRaw()] | [h: names = getPropertyNamesRaw()] | ||
[foreach(name, names, "<br>"): name] | [foreach(name, names, "<br>"): name] | ||
</ | </syntaxhighlight> | ||
|changes= | |changes= |
Revision as of 19:36, 14 March 2023
getPropertyNamesRaw() Function
Usage
<source lang="mtmacro" line> getPropertyNamesRaw() getPropertyNamesRaw(delim) getPropertyNamesRaw(delim, id) getPropertyNamesRaw(delim, id, mapname) </syntaxhighlight> Parameters
delim
- The delimiter used to separate the values in the String List, defaults to","
. Returns a JSON Array if set to"json"
.id
- The tokenid
of the token which has its property names returned, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname
- The name of the map to find the token. Defaults to the current map.
Example
<source lang="mtmacro" line>
[h: names = getPropertyNamesRaw()]
[foreach(name, names, "
"): name]
Version Changes
- 1.5.4 - Added
mapname
parameter option.
Notes
When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the Edit Token window. In other words, even though a property is removed from the campaign properties, it remains available in the MapTool code. getPropertyNamesRaw() will return all token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (i.e., they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use getAllPropertyNames().