The Tree of Widsdom

智慧の樹

Action code in $DisplayExpression


Action code can also be the value of certain attributes. For example, I can prepend the created date of a note to its displayed name while keeping its actual name hidden and intact. I do this by entering action code into the $DisplayExpression attribute. When $DisplayExpression is empty, Tinderbox displays the note’s $Name. But when $DisplayExpression has a non-nil value, this gets evaluated and becomes the note’s new $DisplayName, which is the name you see in all the views. In other words, $DisplayName is $Name unless $DisplayExpression is set.

The <b>Get Info</b> window of the note you are now reading, showing some of the General system attributes. The <code>$Name</code> is unchanged, but the <code>$DisplayExpression</code>, having been set, overrides this. <code>$Created</code> is a date-type attribute and needs to be run through a format string.
The Get Info window of the note you are now reading, showing some of the General system attributes. The $Name is unchanged, but the $DisplayExpression, having been set, overrides this. $Created is a date-type attribute and needs to be run through a format string.