Add and remove multiple tags at once from a file or a folder
Here's two commands that lets you copy tags from one file to another.

xattr -wx com.apple.metadata:_kMDItemUserTags \
"$(xattr -px com.apple.metadata:_kMDItemUserTags /path/to/original)" /path/to/copy
xattr -wx com.apple.FinderInfo \
"$(xattr -px com.apple.FinderInfo /path/to/original)" /path/to/copy


You can iterate through various files to copy the tags to multiple destinations. For applying the above to various files based on the results of a find command (which lets you automatically iterate through results of various searches), see my answer here:


How to tag files (with Finder tags) using parts of a file name?


Here is a small bash script using the previously mentioned commands. You can use it, for example, in Automator.

#!/bin/bash
# copy Tags from 1 file folder to the next

TAGS_FROM="$1"
TAGS_TO="$2"

if [[ -e "$TAGS_FROM" ]] &amp;&amp; [[ -e "$TAGS_TO" ]]; then
  xattr -wx com.apple.metadata:_kMDItemUserTags "$(xattr -px com.apple.metadata:_kMDItemUserTags "$TAGS_FROM")" "$TAGS_TO"
  xattr -wx com.apple.FinderInfo "$(xattr -px com.apple.FinderInfo "$TAGS_FROM")" "$TAGS_TO"
else
  echo "Unexpected input, usage:"
  echo "$(basename "$0") /path/to/original /path/to/copy"
  exit 1
fi


Here is an example of an automator/apple-script (still using the bash commandline...). First set some attributes for this automator.app, then drag a file onto the app. The file will then copy the attributes from the automator.app to itself. I am no Applescripter, so improvement is always welcome.