Code Scope of Action:
Code First Added:
DEPRECATED - use ^value()^. See ^value^.
^get ( attribute[, format] )^
DEPRECATED - use ^value()^ instead.
Gets the value of any attribute you specify. There are syntax considerations for Color and Date type attributes:
- ^get( color attribute )^. In HTML Export, named colours are exported as hex code strings which include the # prefix character, e.g. "#99ff00".
- ^get( date attribute[, format] )^. The format string is optional. Tinderbox offers numerous date formats.
get vs. getFor
How do ^get(attribute)^ and ^getFor(object, attribute)^ differ? ^get(attribute)^ is the same as ^getFor(this,attribute)^. Object names are case sensitive, i.e. this not This.
What if a note's name matches a keyword like current or parent, will Tinderbox pick the note or the relationship? It's undefined. Tinderbox normally seems to find the note, but you should probably avoid relying on this behaviour.
Consider using action code as an alternative
^value^ can be used to call attribute values, with the additional benefit of being able to apply action code modifications. By using a path modifier to the action code's attribute reference, getFor can also be substituted for using ^value^.
^get(CodeType)^: Data Include
^get(Created)^: 9 Mar 2005 14:24
^get(Created,"*")^: Wed, 9 Mar 2005 14:24:21 +0000
…and possible substitutions using ^value^:
^value($CodeType)^: Data Include
^value($Color2)^: dark warm gray dark
^value($Created)^: 09/03/2005, 14:24
^value(format($Created,"*"))^: Wed, 9 Mar 2005 14:24:00 +0000
^value($MyNumber + 8)^: 50
Note how some data types need to be wrapped in a format() call to get ensure usable web values (e.g with Color-type) and how the unformatted output of a Date Type varies between ^get^ and ^value^.
The latter examples show how ^value^ makes it easy to add in transforms on the fly that aren't in the export codes and/or cut down on the amount of export code syntax to be remembered.