Stamps

Stamps

Stamps are self-contained sections of action code that can be run on any selection of note/agent/adornment in any Tinderbox major view; i.e. most views except a note's text window. Stamps are stored in a TBX and only apply to that document. They cannot be dragged between TBXs.

To edit an existing stamp, make any changes and hit the Change button. For a new stamp, simply type a new name in the Name box (deleting any existing value there), then set the desired code in the Action box and - slightly counter-intuitively - click Change.

Stamps menu

Stamps menu

Stamps are created/edited via Stamps menu, Edit Stamp…. The menu is only shown when a major view has focus. The bottom part of the menu lists the TBX's stamps. Here they are greyed out because although a major view has focus, nothing is currently selected.

Stamps menu with selected items

Stamps menu with selected items

Now there is a selection, existing stamps are available for use.

Toggle Display Expression - on

Toggle Display Expression - on

For agents, especially, it can be useful to see a count of their children (i.e. matches) in a major view. This can be done by setting $DisplayExpression. This stamp toggles such an expression on/off in each of the selected item(s). If there is no $DisplayExpression, it adds one. If one is found, the default (no expression) is set. this enable a count to be easily turned on and off without affecting other aspects of the document. Above, shows the expressions set - each agent has a child count shown after it in square brackets.

Toggle Display Expression - off

Toggle Display Expression - off

Here the last 3 agents have the expression toggled off. Note the first two items still show a count.

Toggle effect

Toggle effect

With all items selected the toggle now removes the expression from the fitst two items and adds it to the last 3. In effect the stamp acts as an on-/off feature to set a specific display expression. The action code is:

if($DisplayExpression) {$DisplayExpression=;}else{$DisplayExpression='$Name+":   ["+$ChildCount+"]"'}

If you desire a different display, simply edit the above code as desired.

Toggle agent on/off

Toggle agent on/off

This stamp uses a similar toggle effect as the last but this time to switch agents between 'off' and normal function by altering $AgentPriority. Here the first two agents are 'on' and the others are 'off' as can be seen from their icons at left. The code is:

if($AgentPriority==1){$AgentPriority=-1;}else{$AgentPriority=1;}