This version is out of date, covering development as far as v4.2.5. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
A Tinderbox Reference File : Objects & Concepts : Actions |
Actions |
Actions are applied to notes or containers (including map adornments) and are the effect part of an agent. The parent (with the action) acts on its children. From v2.4.0 a special form of Action called a Rule can be used to act just on the note/agent itself.
Values are changed and information is gathered or changed as a result. Any resulting effects are applied only to the children. Rules are actions that only affect the note itself.
Agents may have actions.
In order to make Tinderbox export codes run in actions and rules it may necessary to start the code after the = sign with a caret and a space, e.g. "^ ". This mechanism is not explained in the manual. Note that the template expression begins with a caret (^) followed by a space. For example:
Name=^ made on ^get(Created,"Y-M-D")^
...sets the name of a note to a formatted date.
When an opening "" syntax is applied, the first space character is ignored (but subsequent spaces are treated as space characters. This avoids possibly ambiguities where Tinderbox might not know whether you intended the initial word to be a markup token. For example, in
Name=^ides of march
... Tinderbox would try to evaluate ^ides as a markup expression,
The space is optional and may be omitted in the (common) case where the template expression begins with a command:
Name=^get(Date)^ jottings
Multiple actions may be applied, if separated with semicolons, even if some of them are template expressions. Previously to v2.3, if you were using a template expression, semicolons were prohibited.
Note that semicolons may not appear inside a template expression action (since the parser would split the expression at the semicolon. Thus:
Name=;Color=red;
... OK
Name=Sing; Dance
... not what you expect
In the second example, the name of the note is set to Sing, and the stamp named 'Dance' is then applied to the note.
To set multiple Key Attributes in a multiple action, place the attributes string in quotes:
"KeyAttributes=Name;OutlineOrder";Name=^ made on 05-Feb-14
From v3.0.0, actions and rules may now use simple arithmetic and logical expressions.
From 4.0.0, a broad range of functions are added that can be run at action/rule scope often removing the need to use export codes. See Actions & Rules.
Up: Objects & Concepts | |
Previous: Links | Next: Agents |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]