Tinderbox 7 Icon

Querying for aliases - find()

The find() operator can be used to run a query, and produces a list of Paths ($Path data). Being a list it is thus not de-duped like an agent's results.

It is important to note this method does not use an agent query but instead its output must be passed to a list attribute or formatted into a string. Thus matches cannot be seen in a Map or Outline view as with an agent. The most likely form of use is thus as a Rule - in a note (though an agent Rule will work just as well).

Thus for note 'Test', this will return a list of the paths to each alias of Test:

find($IsAlias & $Name=="Test") 

Want the aliases of all notes whose name contains the string "Test"?

find($IsAlias & $Name.contains("Test")) 

The above will match names like "Test", "My Test" as well a "Tester" but not "Intestate". By using icontains() for case insensitive matching, "intestate" would be found.

find($IsAlias & $Name.icontains("Test")) 

Want to exclude aliases that have 'Exam' in their path?

find(!$Path.contains("Exam") & $IsAlias & $Name.contains("Test")) 

Want the original find to exclude aliases that are agents' contents?

find($IsAlias & $Name.contains("Test") & !$AgentQuery(parent)) 

Want to display the resulting list as line-by-line entries in $Text?

$Text = find($IsAlias & $Name.contains("Test")).format("\n") 



A Tinderbox Reference File : Agent & Queries : Querying for aliases - find()