DisplayExpression

Tinderbox Icon


Attribute Data Type:   action
Attribute Default Value:   (not set - empty string)
Atrribute Group:   General
Attribute Inherited from Preferences?     No
Attribute Read-Only?   No

DisplayExpression allows the use to customise the way a note's name is displayed within Tinderbox.

Some users find it helpful to use actions and rules to append information to not names, e.g. a word count, number of children or the value of some attribute. However, this does change the actual name of the note and can cause problems with other actions which don't expect note names to change.

DisplayExpression helps overcome this by working in conjunction with another new (read-only) attribute, DisplayName. The latter (q.v.) display's the Name of a note after the action in DisplayExpression is applied. The existing Name value is unaffected allowing other notes to make explicit reference to a given note.

For each note, Tinderbox evaluates that note's DisplayExpression to create the note's name, as displayed. However, if DisplayExpression is empty - or not a valid action syntax expression - then the note's Name value is used instead.

Example rule:

$Name +" (" + $WordCount + ")"

...will display the note's word count in brackets at the end of the note. Thus, "Trip Report" becomes "Trip Report (579)". $Name will continue to return "Trip Report".

This attribute is of the 'action' data type. It takes a string argument which must be valid action syntax.

Subtracting two dates returns the number of days between two times, even if the result is a string such as DisplayExpression. For example:

DisplayExpression: $Name+": "+($DueDate-"today"),/code>

will generate strings like

Buy groceries: 7

Note the parenthesis; if omitted, the expression would be interpreted as an attempt to subtract two strings:

($Name+": "+$DueDate)-"today"


Up: Action attributes
Previous: AgentAction  Next: OnAdd 

[Last updated: 1 Dec 2008]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox