Add tags to many DEVONthink items at the same time

In DEVONthink, when two or more items have exactly the same tags, new tags can be added to them using the tag bar at the lower part of a DEVONthink window. But when their tags are different the message "Multiple Selection" appears in the bar and you cannot edit it. With the following AppleScript you can add multiple tags even to these items.

display dialog "Enter tags to add (separated by commas):" default answer ""
set newTags to text returned of the result

set old_delimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set tagList to text items of newTags
set AppleScript's text item delimiters to old_delimiters

tell application id "com.devon-technologies.thinkpro2"
        set these_items to the selection
        if these_items is {} then error "Please select some contents."
        repeat with this_item in these_items
            set tags of this_item to (tags of this_item) & tagList
        end repeat
    end try
end tell

1 comment:

Anonymous said...


thank you very much for this tip. It does work great!

cu Marco