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
Identifying notes with the same name (Read 1173 times)
Eric Brown
Full Member
*
Offline



Posts: 3

Identifying notes with the same name
Nov 06th, 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
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Identifying notes with the same name
Reply #1 - 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?
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Eric Brown
Full Member
*
Offline



Posts: 3

Re: Identifying notes with the same name
Reply #2 - 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.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Identifying notes with the same name
Reply #3 - 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.


Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Identifying notes with the same name
Reply #4 - 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)
Back to top
 
 
WWW   IP Logged
Eric Brown
Full Member
*
Offline



Posts: 3

Re: Identifying notes with the same name
Reply #5 - Nov 8th, 2016, 5:15am
 
Thanks Mark A and Mark B.  I've got it working now.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Identifying notes with the same name
Reply #6 - 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!"
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print