Is it possible to extract OSX "Get Info" data?

4

1

I have over 2000 .mov files that were painstakingly logged using the Comments section of the Get Info window (someone listed the clips featured in each .mov under Comments in Get Info). I'd like to be able to search this data without the drive. Is it possible to extract the "Get Info" data from multiple files into one CSV file?

almrie

Posted 2018-01-19T01:30:56.447

Reputation: 43

Answers

5

Yes, it's stored as binary plist (Property List) data in the com.apple.metadata:kMDItemFinderComment extended attribute for the file.

You can use the xattr -p attribute filename command to view the extended attributes for files, but it only dumps hex to stdout, so you'll need to use a tool like xxd -r -p to convert the hex dump back into a binary plist, and then you can use plutil -p to dump the plist.

Here's some bash shell scriptage you can paste into the Terminal to dump the Finder Get Info window comments for all .mov files in the current directory:

for FILE in *.mov; do
    xattr -p com.apple.metadata:kMDItemFinderComment $FILE | xxd -r -p > $FILE.comment.plist && plutil -p $FILE.comment.plist
done

Spiff

Posted 2018-01-19T01:30:56.447

Reputation: 84 656

Thanks, Spiff. Sorry for the delayed response -- I've been traveling and I didn't have the external drive where these videos are stored. Can you back up a few steps? I'm not a developer. I can see the contents of my drive in Terminal, but I'm not sure when or where to paste the script. – almrie – 2018-01-22T05:08:50.417

@almrie Open a new Terminal window, use the "cd" command to navigate to a directory containing .mov files, and then paste the lines I gave you right into the Terminal at the normal shell prompt. Note that since I assumed some Unix shell scripting knowledge, I only wrote this example to get you past the extraction part, and I was leaving it up to you to put it into an actual .csv. – Spiff – 2018-01-22T18:32:51.130