Would greatly speed tagging if you could pop up a quick menu of all existing tags, like the “group selector” (only with multiple selections allowed). Click on the ones you want, and they’re instantly applied to the selected items.
Would be scriptable, if there were an equivalent to “name of every database” for tags. Could then simply write:```
set chooseTags to (choose from list theTags with prompt {“Choose tags to apply:”} default items “” with multiple selections allowed)
I copy this code and run it from the script editor just to test to see what happens with some files selected so I get multiple selection in the info window. But don’t get any popup menu after running. How do I use this code to get this to work?
I see… and how does one achieve this exalted status?
Anyway, here’s the full script: ```
tell application “DEVONthink Pro”
activate
try
set this_selection to the selection
if this_selection is {} then error “Please select some contents.”
set theTags to name of every parent of current database whose tag type is ordinary tag
set myTags to (choose from list theTags with prompt {“Choose tags to apply:”} default items “” with multiple selections allowed)
repeat with this_item in this_selection
if exists tags of this_item then
set current_tags to the tags of this_item
set new_tags to current_tags & myTags
else
set new_tags to myTags
end if
set the tags of this_item to new_tags
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
Thanks Christian!
I have merged the codes now and get the popup menu, but when I have choose a tag, it doesn’t apply to the selected records, is it something more I need to do with the script?
What, if anything, controls the display order of the tags in the list? The script works great, but the list of tags to select from appears in no apparent order.
Yeah, that’s another possibility meaning that my brain is always full of details of upcoming releases But the first solution will be able to support other tag types too.
When I try this new beginning of the script I don’t get only the tags for the selected files, instead I get all the tags like the first script.
It would be awesome to only get the tags for the selected files, so it easy to remove the tag that you don’t want on the files.
I know that this script sentence doesn’t work, but this is what I mean:
set theTags to name of every tag group of this_selection
Hmm, I have been thinking about some solution to this. But without any success. I suppose for the moment that it’s very hard to write a script to choose the tags that you want to delete for only the selected files.
So the only solution I think that is possible for now to delete tags, is to use acoynes script solution to get all the tags to a popup list and when write a script to delete the tags instead for adding them.