Skip to content

Instantly share code, notes, and snippets.

@iandol
Forked from scottstanfield/convertOM2OSXTags.sh
Created July 27, 2018 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iandol/99fefddee911a41e90001a8d5634b529 to your computer and use it in GitHub Desktop.
Save iandol/99fefddee911a41e90001a8d5634b529 to your computer and use it in GitHub Desktop.
This script converts OpenMeta to OS X Mavericks tags.
#!/bin/bash
#
# This script converts OpenMeta to OS X Mavericks tags.
#
# http://code2k.net
#
# Copyright © 2013 CODE2K:LABS. All Rights Reserved.
mdfind "kMDItemOMUserTags == *" -onlyin "." | while IFS= read -r file; do
echo "$file"
plistTags=$(mdls -plist - -name kMDItemOMUserTags "$file"|grep -v "kMDItemOMUserTags\|dict")
xattr -w com.apple.metadata:_kMDItemUserTags "$plistTags" "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment