Tinderbox v9 Icon

Evaluating expressions

Tinderbox allows action code in the document to be used in two ways: act on and evaluate

evaluation of an expression:

evaluate note with expression 

The first argument note is an AppleScript specifier for the note, which will be bound to this for the evaluation. The evaluate command may be issued to either the document or to a specific note.

To remove any local value assigned to the attribute $Width:

delete value of ( attribute of theNote named "Width") 

This is equivalent to the Tinderbox command $Width=;.

Performing actions

To perform an action on the designated note:

act on theNote with "…action…" 

An 'action' is typically one or more assignment or conditional statements (expressions), such as $Color="red";$Badge="ok";. Within an 'act on' code, = means an 'assign';

Thus an 'act on' is akin to stamping a note (altering the note via the effect of the action code).

Note: the 'act on' command does not return a value.

Performing evaluation

This returns the result of evaluating an expression:

set myResult to evaluate theNote with "…expression…" 

Within an 'evaluate', = means a 'comparison' (although the unambiguous operator == is preferred). An 'evaluate' operation presumes the content of the note is action code whose evaluated result is to be returned.