#!/bin/bash
# copy Tags from 1 file/folder to the next
TAGS_FROM="$1"
TAGS_TO="$2"
if [[ -e "$TAGS_FROM" ]] && [[ -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
Last active
January 9, 2018 18:34
-
-
Save vookimedlo/d775672e8220f35898bd23506a45cc18 to your computer and use it in GitHub Desktop.
MacOS: Tag files from command line
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment