This version is out of date, covering development from v5.0.0 to v5.12.2. It is maintained here only for inbound reference links from elsewhere.

Jump to the current version of aTbRef.

Tinderbox Icon

Using Export codes in Actions (DEPRECATED)

This pages describes features, codes or syntax whose use is now DEPRECATED, i.e. not advised either for new or continued pre-existing use.

Deprecated aspects of Tinderbox may be supported on a legacy basis but the latter support can't be presumed to be indefinite. Therefore you should update your active TBX documents to latest practice as soon as practical.

DEPRECATED USAGE

In general, post v4, using export codes other than in export templates is deprecated. Only two export codes cannot be replicated with action code, ^docTitle^ and ^version^.

In order to make Tinderbox export codes run in actions and rules it may necessary to start the code after the = sign with a caret and a space, e.g. "^ ". This mechanism is not explained in the manual. Note that the template expression begins with a caret (^) followed by a space. For example:

$Name=^ made on ^value($Created.format("Y-M-D"))^ 

…sets the name of a note to a formatted date. Now use this, all in action code, instead:

$Name="made on " + $Created.format("Y-M-D") 

When an opening "" syntax is applied, the first space character is ignored (but subsequent spaces are treated as space characters. This avoids possibly ambiguities where Tinderbox might not know whether you intended the initial word to be a markup token. For example, in

$Name=^ides of march 

…Tinderbox would try to evaluate ^ides as a markup expression,

The space is optional and may be omitted in the (common) case where the template expression begins with a command:

$Name=^value($Date)^ jottings 

$Name=$Date+" jottings" 

Multiple actions may be applied, if separated with semicolons, even if some of them are template expressions.

Note that semicolons may not appear inside a template expression action (since the parser would split the expression at the semicolon. Thus:

$Name=^value($User1)^;$Color="red";…OK

$Name=^ Sing; Dance …not what you expect

In the second example, the name of the note is set to Sing, and the stamp named 'Dance' is then applied to the note. Now, in v4.6+ use this instead:

$Name=$User1;$Color=="red"; …OK

$Name="Sing"; Dance; …either

$Name="Sing; Dance"; …or

To set multiple key attributes in a multiple action, place the attributes string in quotes:

"$KeyAttributes=Name;OutlineOrder";$Name=^ made on ^value($Created.format("Y-M-D"))^ 

Now use:

"$KeyAttributes="Name;OutlineOrder";$Name="made on "+ $Created.format("Y-M-D") 


Possible relevant notes (via "Similar Notes" feature):


A Tinderbox Reference File : Actions & Rules : Using Export codes in Actions (DEPRECATED)