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. These criteria can be set from the Create/Rename dialog of the agent, its Info view 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 two possible solutions:
- Make an agent:
$AgentQuery & !$Sort
$Sort="OutlineOrder";or "Name", etc.
- Make an agent, set just the sort order and make is a prototype.
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 doesn't 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. From v5.7.0, the sort transform pop-up menu has the option 'original note'. Setting this transform tells Tinderbox to use the originals note's value instead of the aliases, should the two differ.