Help an artist with her catalogue - MDMItemFinder comments

Started by Imogen, June 05, 2017, 03:19:50 PM

Previous topic - Next topic

Imogen

Dear forum members

This should be simple. But I need help. A friend is an artist with many JPG pictures of her paintings on her Mac.
Each jpg has in its Finder comments (which I believe from reading the forums is MDItemFinderComment specifically) the information of the painting's title, size, materials and date.
She has entered this information using OSX's Get Info window to the Comments field for each painting over the years.

When she has an exhibition, she wants to put all the relevant JPGs into one folder on the Mac, then use something like ExifTool to extract the information so that she ends up with a new text file that contains one set of data per line. This file can be used to create the catalogue for the exhibition without having to retype lots of info.

So let's say we have three files A.jpg, B.jpg and C.jpg in a folder. You select the files, read the MDItemFindercomment for each but write each comment as a separate line to a new text file. Would this be possible perhaps with AppleScript and ExifTool?

The end product would be:

Title of A, size of A, materials of A, date of A (which is the date she specified in the comments, not the data the jpg was created...)
Title of B, size of B, materials of B, date of B
Title of C, size of C, materials of C, date of C

Any help much appreciated. I did look at the Applescript example in the separate thread but it was trying to write to multiple files. I just want to collect up all the comment fields from files in a specific folder and then write them line for line to a new file (can be a text file).

Many thanks

Imogen

StarGeek

It may take some work and advanced formatting to get it exactly how you want but the basic command should be something like
exiftool -MDItemFinderComment -w+ %dTextFile.txt FileOrDir

That will write a file in the target directory with MDItemFinderComment:    <contents of MDItemFinderComment> on each line for each file.  If you need to include the filename, you'll probably have to use the -p option with the advanced formatting.

If you could give an example of the output of exiftool -MDItemFinderComment then we can be more helpful with getting the output exactly what you want.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Imogen

Thank you! There's no need for advance formatting - that can be done with a Word macro for what she wants and she's quite good with Word. It's purely extracting the MDItemFinderComment data from the .jpg files in a specific folder to a .txt or .doc file.

The response from the Terminal program to
exiftool -MDItemFinderComment -w+ %dTextFile.txt FileOrDir
was:

File not found: FileOrDir
    1 files could not be read
    0 output files created

When I just do the basic command from the right directory on one specific file, it does return the correct information:

MD Item Finder Comment          : Exif testing comment 2

How can we tell Exif only to read comments from  .jpg or .JPG files in the folder?

I noticed my artist friend had put commas within some of her comments (so for example the Title of the picture might include a comma). I tested that and it looks like the commas come through fine, they don't need to be "escaped" or anything.

Best wishes

Imogen

Phil Harvey

Hi Imogen,

You weren't meant to type "FileOrDir" -- instead of typing this, drag and drop the folder onto the Terminal window.

Also, you can add -ext jpg to process only JPG files.

And if you want the file names along with the comments, you could use CSV format.  So I would do this:

exiftool -csv -ext jpg -MDItemFinderComment FileOrDir > out.txt

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Imogen

Cheers Phil! Sorry for being a dope - I should have realised about the dragging and dropping. This is fab. I wish I'd discovered it years ago.

I don't need the file names (though it's really useful to be able to export in csv for other tasks). So I'm doing this:
exiftool -ext JPG ~/Documents/Beug -MDItemFinderComment -w+ %dout.txt

and getting this in out.txt which is all fine:

MD Item Finder Comment          : Exif testing comment 2
MD Item Finder Comment          : Exif test Jim Edwards, test comma
MD Item Finder Comment          : Testing Exif SUH logo

But I actually don't want the first part that's the same - MDF Item Finder Comment       :
I can take it out in Word no problem, I'm just trying to make it incredibly simple for her if I can.
So is there a way to only get the comments one per line like this ?

Exif testing comment 2
Exif test Jim Edwards, test comma
Testing Exif SUH logo

Really appreciate the reply. Is there a way to make a donation somewhere?

Thanks again

Imogen

StarGeek

Quote from: Imogen on June 06, 2017, 07:40:16 AM
I don't need the file names (though it's really useful to be able to export in csv for other tasks). So I'm doing this:
exiftool -ext JPG ~/Documents/Beug -MDItemFinderComment -w+ %dout.txt

Add -s3 to the command
exiftool -s3 -ext JPG ~/Documents/Beug -MDItemFinderComment -w+ %dout.txt

QuoteReally appreciate the reply. Is there a way to make a donation somewhere?

There is on the front page.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype