Reputation: 313
I know how to set file keywords (com.apple.metadata:kMDItemKeywords) using a command line process that involves creating a plist, converting to binary and using xattr. It works but is painful. I'm hoping there is a better way.
Can anyone explain how to set file metadata using Apple's tools? Or point to websites that cover this?
All pointers appreciated.
Upvotes: 1
Views: 2585
Reputation: 371
Try to modify the code below to fit your needs:
set aFile to choose file
set a to quoted form of POSIX path of aFile
do shell script "xattr -w com.apple.metadata:_kMDItemUserTags '(\"orange\\n6\",\"test\")' " & a
Happy keywording!
Upvotes: 2