Using Scripts to exchange one tag for another

I’m looking for a way to switch tags in one or more items. Eg. Switch “Tier 1” tag with “Tier 2” tag, while preserving any of the other tags already assigned.

Can someone point me in the right direction in how to script this, or better yet, share a script someone has done for this (I did try searching the forum.).


Someone may come along and post a better solution for you, but here is a two-step approach that works. Select ‘Support Assistant’ from the Help menu, then click on ‘Install Extras’, and install the 2 scripts ‘Remove Tags from Selection’ and Add Tags to Selection’. Run the respective scripts on a selection of documents to remove/add tag(s).

If you want to do this globally (Tier 1 becomes Tier 2 and vice versa) then rename the tags – they are merely group names and changing the name doesn’t change the assignment.

In the Tags group of your database:
Rename Tier 1 to Tier x
Rename Tier 2 to Tier 1
Rename Tier x to Tier 1


@Korm: Thanks for the suggestion. To clarify. I would like to do this on a per document basis (so I can move individual documents from tier 1 to tier 2 for example with the “stroke” of an applescript.)

@Greg: Thanks for the extras scripts suggestion. I ended up combining those into one script to serve the purpose even better than I’d hoped. I can even change “Tier” tags in multiple items that have otherwise different tags. I’ve attached the script to a QuicKeys shortcut and – bam! – I can change “Tier” tags with literally two keystrokes. Perfect! Awesome!..Niice! Thank you! And thanks to Snare Dubes & Christian Grunenberg for their work on the “Remove tags from selection” script and “Add tags to selection” script respectively. (Since they’re copyrighted, I’m reluctant to repost them with my changes.)