Tinderbox allows users to extend its capabilities by giving users access to the command line (CL) in a number of ways:
- Action code:
- Attributes:
The attributes enable stored command lines (or action code expressions) for post-processing of (HTML) output and (AutoFetch) input. The most flexible method is runCommand(). See the referenced notes for more detail.
The runCommand() operator can also be used to call external scripts, i.e. script files stored in the OS outside the TBX document, using an POSIX-style path (i.e. slash-delimited, not colon-delimited); paths can be absolute or relative. Script names without a path are assumed to be in the shells current working directory ('pwd').
CL code can also be stored in string attributes, such as $Text, but only when using runCommand(); the other methods above require literal CL code. Referenced CL code is called thus:
runCommand($Text("CL example"))
Using a note's $Text to hold code can be very useful for CLs too long or complex to work on easily in a $Rule or $OnAdd box. In the text window you can turn off the sidebar, use a monospace font, crank up the font size, etc. - or use the built-in prototype 'Code';.
Because of the external calls involved, CLs used in action code such as agent actions, can have significant impact on agent cycle time. This is especially true if using CL code to process text. In an agent context, consider turning the agent off (via $AgentPriority) when processing is not needed.
It is worth noting Tinderbox's support for single-quote and double-quote string quoting but bear in mind that there is no method for escaping a double quote character.
