There are several examples of managing unused Tags I could mine, but no script was complete with all the options I wanted to have. Therefore, here is a script that displays Tags which are used only once in the database and allows you to decide to delete that Tag and then continues displays the Tags which have not been used at all and again allows you to decide to delete it.
<pre><code> (*
This script displays Tags which are used only once in the database and displays a delete dialog for those Tags and then continues to display the Tags which have no assigned database items all and again displays delete dialogs for those.
tell application "Yojimbo" set everyTag to every tag repeat with aTag in everyTag set itemColl to ¬ (every database item ¬ whose tags contains aTag) if (count of itemColl) is 1 then repeat with tagItem in itemColl display alert "Unique tag: " & ¬ (name of aTag) & ¬ "\nItem: " & ¬ (name of tagItem) ¬ buttons ¬ {"OK", "Delete Tag"} ¬ default button 1 if button returned of result ¬ is "Delete Tag" then delete aTag end if end repeat else if (count of itemColl) is 0 then display alert "deleting " & ¬ (name of aTag) ¬ buttons ¬ {"OK", "Cancel"} ¬ default button 1 if button returned of result ¬ is "OK" then delete aTag end if end if end repeat end tell </code></pre>
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Yojimbo Talk" group. To post to this group, send email to yojimbo-talk@googlegroups.com To unsubscribe from this group, send email to yojimbo-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/yojimbo-talk?hl=en -~----------~----~----~----~------~----~------~--~-
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!