An action is an automatic way of setting a certain attribute to a certain value (with the exception of system read-only attributes which can't be altered). In the context of this section, Rules should regarded as synonymous as they differ only in the scope of action.
Agents can have actions. An agent performs its action on all the notes it finds that match its agent query.
Notes can have actions. A note performs its action on all its children — but not on the children's children, i.e. descendants. A Rule is a special form of note action whose effect is applied only to the note and not any children. To effect both the note and children, the same code can be added as both and action and a rule.
Important note: action code can not create new notes or delete existing ones.
Actions and rules may use simple arithmetic and logical expressions.
$Width=5+2;
$Width=$Height(parent)*1.5;
$Urgent= (Overdue | Essential);
$Width =($Width(/Configuration)+1)*$Scale;
Because Tinderbox recognises operators such as + and -, notes whose names begin with characters other than letters and numbers may sometimes be interpreted in unexpected ways. For example, if a note is named "6*7", rules like
$Prototype=6*7
...might be parsed as a multiplication with the result of 42.
$Prototype="6*7"
...should have the expected effect. Quoting characters will always cause Tinderbox to treat such content as literal text.
Actions and rules may use computation with data attributes - including attribute values from other notes. For example:
$DueDate = $DueDate(parent) + "7 days";
$DueDate = $ExpiryDate(parent) - "10 days";
Date attribute values can also be computed with literal dates and date designators:
$DueDate = "November 15, 2004" + "7 weeks"
Note in the previous examples the actual and partial date strings use quotes.
Long term users should revisit code to ensure all string literals are quoted as current support for non-quoted string usage is for legacy purposes and will be withdrawn.
- Operators
- Compound Actions
- Conditional Actions (if clauses)
- Conditional statements using multiple arguments
- Expressions in paths
- Delaying code execution in Prototypes
- Stand-alone expressions
- The 'dot' operators
- Chaining 'dot' functions
- Stamps
- Setting an attribute to (no value)
- Short Boolean form
- Setting an attribute to re-enable inheritance
- Self-Cancelling Rules & Actions
- Using long sections of code
- Using .each() for loops
- Concatenation versus addition
- Parentheses as a guide to code execution
- Updates and cascading actions
- Debugging user Action code
- Invoke command line scripts via back-tick (DEPRECATED)
- Using Export codes in Actions (DEPRECATED)
