user1625344 user1625344 - 1 year ago 142
AppleScript Question

Setting File Metadata with Applescript or Automator

I know how to set file keywords ( 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.

oa- oa-
Answer Source

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 '(\"orange\\n6\",\"test\")' " & a

Happy keywording!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download