I have a PDF file. If I look at the Get Info window, the Title under More Info is "Title1". I am trying to set this value using terminal so I can eventually turn it into an applescript.
See Stackoverflow question Mac OS X : add a custom meta data field to any file
I used the answer from Anderson Freitas to correctly set an author by using the command"
xattr -wx "com.apple.metadata:kMDItemAuthors" "`xxd -ps author.plist`" "Put File Name Here.pdf"
However, if I replace kMDItemAuthors with mMDItemTitle, the command runs without error, but no changes are seen in the title either by looking at Get Info or by using mdls on the command line.
The contents of my title.plist file is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string>Title2</string>
</plist>
The actual command I run to set the title is:
xattr -wx "com.apple.metadata:kMDItemTitle" "`xxd -ps title.plist`" "Put File Name Here.pdf"
Any thoughts where I might be doing something wrong?