Tinderbox 7 Icon

Agent & Queries

Queries are action code expressions in a conditional form that must resolving to true/false statements. Agent queries result in the agent creating a list of aliases that will include each matching item once. Thus even if the original and/or one or more of its aliases are all within the scope of the query, that item will create a single alias in the agent. An exception is allowed, where it is needed to locate an original and all its aliases, by using a contains() query based on the item's name as this will match all containers of both that note and all of its alias(es).

Agents - including smart adornments - can match notes (including container notes), separator notes, aliases, other agents but can not match map adornments. Adornments are the one exception to an agent's ability to query any object in the document.

References in this section to "BooleanAttribute", DateAttribute", etc.," refer to any system or user attribute, that is of the data type specified. Thus "BooleanAttribute" implies any attribute of the data type "Boolean".

Note that an agent's query only controls which notes are matched and whose aliases are added as children of the agent. Anything done to the (aliases of) matching notes is controlled via the the code stored in the AgentAction attribute. Action code can also be viewed and edited via the Action Inspector.

Queries are written in action code. In the very early days of Tinderbox there was a discrete syntax for queries, using operators with a # prefix. If such code is seen in old files or code examples, it should be re-written in existing action code before use.

Unlike action code expressions, queries do not and should not use a terminating semi-colon. As this may easily be done by mistake, from v7.2.0, Tinderbox will ignore a terminating semi-colon if found in a query.

A Tinderbox Reference File : Agent & Queries