Skip to content

Instantly share code, notes, and snippets.

@code2k
Created October 23, 2013 18:48
Show Gist options
  • Save code2k/7124301 to your computer and use it in GitHub Desktop.
Save code2k/7124301 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 == *" | 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
@scottstanfield
Copy link

This works. Thanks!

@iandol
Copy link

iandol commented Jul 27, 2018

Still works on High Sierra, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment