Tinderbox v11 Icon

this, that, agent, adornment, original and current

A core part of designator use is the initial context. The default context is the current selection, otherwise referred to as this. When referring to attribute values, this is implicit in the short form seen below. the following are equivalent:

$Name
$Name(this) (more explicit but generally redundant)

When addressing a value in a parent note, again note the same implicit this, as these are equivalent:

$Xpos(parent); 
$Xpos(this(parent)); (more explicit but generally redundant)

A number of special designators are supplied for less usual contexts. With agents, their children are aliases of matched notes. Thus the parent of the alias is the agent, but to address the parent of the alias' original note use. For instance:

$MyString(agent) = $Name(parent(original));

Adornments and smart adornments offer a similar contextual quirk. For a note on top of (in front of) an adornment, the adornment designator sets its $MyString to the adornment's $Name:

$MyString = $Name(adornment);

The find() operator has the problem the often it is necessary for the query to reference a value in the calling note, as opposed to the note tested. The that operator is used to allow such a reference and it is used only in a find() query. Here, the query matches any note whose $MyString value matches the $Name of the note running the find():

find($Name==$MyString(that); 

Note that find() is itself both and operator and a designator and most often used with operators like collect() where the scope of the operator can only be defined by a query rather than a simple group designator like children.

Because an OnRemove runs after a note is considered removed from its old container, unlike in an OnAdd, the parent designator cannot be used. To allow the ex-container to be referenced, the that operator or used. Note: its use in the latter role does not affect the more general use of that within a find() query.

The current designator is used for export template operation using ^include()^ type operations and where nested calls may make the meaning of this ambiguous.