Tinderbox v8 Icon

^if( condition )^

Code Type: 

Code Scope of Action: 

Code First Added: 

Code Altered: 

 Conditional Mark-up   [other codes of this type]

 n/a   [codes with similar scope]



^if( condition )^

Test if the condition is true, then includes everything from the ^if statement to the ^else^ or the ^endif^. If the else/endif mark-up is omitted the text following the closing ) bracket of the condition is returned.

Unlike in very early versions of the app (and thus old examples, the condition statement is a query written in action code (essentially the same syntax as if writing an if() action test. For example,


…is true if the note's title contains the string "tbx",


…is true if the note's title does not contain the string "tbx", and


…is true if the note's width exceeds 5.0

For the first two examples above the value matched can be an actual string or a regular expression.

In the ^if^ condition, the query is always evaluated in the context of this note.