There ought to be some way to batch-delete tags from some items, but not others. Right now, you can remove them one at a time, or from all at once. I’ve written a script (see below) to allow deleting specified tags from selected items, but unfortunately it runs all the remaining tags for that item together (anyone got a fix?)
Right now new folders are automatically tagged, as are all items within a tagged folder. There should be a preference setting giving users the option of turning each of these off.
Okay: here’s that script I mentioned:```
tell application “DEVONthink Pro”
activate
try
set theSelection to the selection
if theSelection is {} then error “Please select some contents.”
set listTags to (name of every tag group of current database)
set chooseTag to choose from list listTags with prompt {"Delete tag from \"" & name of current database & "\""} default items "" with multiple selections allowed
set searchString to chooseTag as string
set replacementString to ""
repeat with theItem in theSelection
set theTags to the tags of theItem as string
if theTags contains searchString then
set AppleScript's text item delimiters to searchString
set text_item_list to every text item of theTags
set AppleScript's text item delimiters to replacementString
set newTags to text_item_list as string
set the tags of theItem to newTags
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then
try
display alert "DEVONthink Pro" message error_message as warning
on error number error_number
if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
end try
end if
end try
-- remove a tag from selected documents
-- based on a concept provided by acoyne May 17, 2010
-- http://www.devon-technologies.com/scripts/userforum/viewtopic.php?f=4&t=10905&start=0
tell application "DEVONthink Pro"
activate
try
set theSelection to the selection
if theSelection is {} then error "Please select some contents."
set listTags to (name of every tag group of current database)
choose from list listTags with prompt {"Delete tag from \"" & name of current database & "\""} default items ""
set searchString to result as list
repeat with theItem in theSelection
set theTags to the tags of theItem as list
if searchString is in theTags then
set newTags to "" as list
repeat with thisTag in theTags
if thisTag is in searchString then
copy "" to the end of newTags
else
copy thisTag to the end of newTags
end if
end repeat
set the tags of theItem to newTags
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then
try
display alert "DEVONthink Pro" message error_message as warning
on error number error_number
if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
end try
end if
end try
end tell
Oh, yes, you’re right. I just added “with multiple selections allowed” to the “choose from list” command. For some reason it didn’t seem to work before, but I see it does.
Well this is very odd: I had thought that was the case at first, too (see above). But now I find it’s working fine. Are you using korm’s script, or mine? (I think it works with his, but not mine.)
Won’t work just by adding “multiple selections allowed” – the loops need amending too. It’s simple, but can’t until maybe this weekend unless someone wants to fix it. Meanwhile, do one tag at a time.