By default, agents have no specific sort order for their matches.
The user may impose a deliberate single or two-level sort using criteria set via the Sorting group of system attributes, most easily accessed via the Action Inspector's Sort tab. Other options include the agent's Get Info or by setting the attributes via action code.
There is no document-level setting for agent sort order. If it is desired to use a sort order across the TBX, there are several possible solutions:
- Make an agent:
- Query:
$AgentQuery & !$Sort
- Action:
$Sort="OutlineOrder";
or "Name", etc.
- Query:
- Make an agent, set just the sort order and make it a prototype.
- Use the action from above as a stamp, and use the stamp on any agent as required.
When sorting by $OutlineOrder, the original note's value is used, regardless of whether the match is to an original or an alias. This gives speedier response whilst generally giving an acceptable sort order.
Sorting the contents of agents poses an extra problem to that of normal containers. This is because agents collect aliases of notes and in some cases the alias does not share attribute values with its original note, e.g for $Width and $Height, the intrinsic attributes of an alias.
Thus setting $Sort (and $SortAlso) for a given attribute may not always have the intended consequences. The sort transform pop-up menu has the option 'original note'. Setting this transform tells Tinderbox to use the original note's value instead of the aliases, should the two differ. The 'original note' transform is useful if you want the aliases to sort in the outline order of their original notes.