Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Tinderbox applications >> Identifying notes with the same name
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1478450062

Message started by Eric Brown on Nov 6th, 2016, 11:34am

Title: Identifying notes with the same name
Post by Eric Brown on Nov 6th, 2016, 11:34am

I imagine this is something that is relatively straightfoward, but I was wondering if there was a way to create an agent that can determine whether or not a note name is already in use within the same (large) container.  I haven't been able to quite get my head around it.  I apologize if this has been covered elsewhere.

-Eric

Title: Re: Identifying notes with the same name
Post by Mark Anderson on Nov 6th, 2016, 12:33pm

There's no built-in method as generally you wouldn't use the same name for a note twice. An agent query or a find() will return a separate match for each discrete original item with the same name. Note also that if an original of the same name in a different container has an alias in this container that too would match for structure queries to filter aliases (&$IsAlias==false).

Given the above, it might be easier to try and avoid the need for this.  What is the workflow that is causing regular duplicate names?

Title: Re: Identifying notes with the same name
Post by Eric Brown on Nov 6th, 2016, 12:41pm

Hi Mark,

Thanks for the response.  The workflow in question is mainly taking reading notes from a number of sources.  I put all of my notes in one big bucket and then use agents and "smart" adornments to sort them. I do try to name the notes differently, but just encountered an issue where I had a duplicate name (in a containter containing several hundred notes).  I was just wondering if there was an easy way to create an agent that would help me identify the fact that I have created a duplicate name (i.e. by changing the border color, or some such), despite my efforts to not do so.

Title: Re: Identifying notes with the same name
Post by Mark Anderson on Nov 6th, 2016, 1:55pm

You could always sort the container and view in outline view. A quick scroll through should allow duped to be spotted by eye. Note outline order defines the Z-order (stacking) in map view so this may affect items that overlap in map view if that is important.

You could try a 2-stage approach. One agent finds and marks dupes, the second finds the dupes. In this example we'll search the container 'Projects'.

Agent -
Name: "Agent ONE"
Query: inside("Projects") & $IsAlias==false
Sort: "Name"

Agent -
Name: "Agent TWO"
Query: inside("Agent One")
Action: if($Name==$Name(prevSibling(original))){$Badge="waring";}

N.B. above is not tested as I'm just headed out. It should result that were there are 2 (or more) notes of the same title, the second (and third match, etc.) should have the 'warning' badge.

Of course you can mark the notes some other way but this should give you some ideas.



Title: Re: Identifying notes with the same name
Post by Mark Bernstein on Nov 7th, 2016, 12:29pm

1) Make an agent that gathers all the notes in the container of interest. Call this NAME AGENT
2) Sort NAME AGENT agent by $Name
3) make a second agent called DUPLICATES

    query: inside(NAME AGENT) & $Name=$Name(previous)

Title: Re: Identifying notes with the same name
Post by Eric Brown on Nov 8th, 2016, 5:15am

Thanks Mark A and Mark B.  I've got it working now.

Title: Re: Identifying notes with the same name
Post by Mark Bernstein on Nov 8th, 2016, 10:37am

Fun project for readers: modify the solution above to that, whenever your create a duplicate note, Tinderbox speaks to you and says "Excuse me, but the note named ‘Fred” is a duplicate!"

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.