user1625344
user1625344

Reputation: 313

Setting File Metadata with Applescript or Automator

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

Answers (1)

oa-
oa-

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

Related Questions