Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Solution for finding aliases of a given note (Read 2063 times)
Lucas D
Full Member
*
Offline



Posts: 133

Solution for finding aliases of a given note
May 29th, 2011, 10:44pm
 
I'm still a beginning user, and it's quite possible that other/better solutions to this already exist, but I thought I'd share what I've come up with as a method for finding aliases of a given note.

I created a prototype called "Find aliases". This prototype contains an agent called "Alias locations" (and the prototype is set to bequeath children). The agent uses the following query:

Code:
contains($Name(parent(agent))) & !AgentQuery & $Name(this)!=$Name(grandparent(agent)) 


When I want to find the aliases of a given note, I first go to Outline View and make sure I've selected the original note (rather than an alias). Then I set the prototype of the note to "Find aliases". The note then automatically inherits its own copy of the agent called "Alias locations". This agent then populates with the names of the containers of any aliases of the note in question. A translation of the agent query would be as follows:

Code:
contains($Name(parent(agent))) 

This finds all instances the note in question (which is designated here as the parent of the agent, since the agent was bequeathed as its child).

Code:
& !AgentQuery 

This excludes other agents as locations for the search. This is optional, of course.

Code:
& $Name(this)!=$Name(grandparent(agent)) 

This excludes the parent of the original note (the grandparent of the agent) from the list of results. I only want to find locations of aliases, since I'm already at the location of the original.

Well, there you have it. The only catch is that the steps outlined above assume the note in question is childless. If it already has children, then I follow these extra steps: First, create a new child note. Then apply the prototype to this child note. The child will then be bequeathed with the desired agent. Unindent the agent one level so it will then operate on the target note. (This latter method can also be used in any case to avoid changing the prototype of the original note.)

If you know of a better/different way to do this, or have any questions or thoughts, let me know.

EDIT (later): In most cases it would probably be more useful to replace !$AgentQuery (the middle clause above) with something more specific to include those agents that would be useful but exclude others that wouldn't be. That's what I did, but that part of my solution is only of relevance to my own set-up.
Back to top
 
« Last Edit: May 30th, 2011, 1:08am by Lucas D »  

WWW   IP Logged
Pages: 1
Send Topic Print