Querying for aliases - find()

Tinderbox Icon

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.

Ii 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 can't 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") 


Possible relevant notes (via "Similar Notes" feature):

Up: Agent Queries
Previous: Querying for aliases - agents  Next: Aliases, children and descendants 

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

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox