Converting IPTC keywords to Mac tags (Windows->Mac)

Started by mrhoward, March 03, 2020, 05:17:11 AM

Previous topic - Next topic

mrhoward

Hello all,

I am very new to the fantastic Exiftool and would have a question. I searched the forum but could not find an appropriate answer, but that's maybe from a misunderstanding in the tool for me. (I hope not, I don't want to bother anyone)

I recently copied several images (JPG mostly) from a Windows 10 system to a MacBook Pro.

I see all the metadata known as "IPTC keywords" when I right click and view the information in Finder on the Macbook, but I would of course like to use this information directly in Finder.

So my question is, is there a possibility using Exiftool to actually read the IPTC keywords and copy them as "tags" on the Macbook ? Either as a new file or as an update of the current file.

I'd like doing that for several folders, so I need to do this recursively.

Thank you very much !

Phil Harvey

Assuming that your keywords are stored in XMP:Subject, the following command may do what you want:

exiftool "-mditemusertags<subject" -r DIR

but note that this requires you have the "tag" utility installed.  This may be installed with "brew install tag" if you have homebrew installed.

- 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 ($).

mrhoward

Thank you very much for your answer. For the moment I am looking at where the data is stored in the JPG file.

Output of simple exiftool command on the Macbook:


>exiftool DSC_0638.JPG | grep -i mykeyword1
XP Keywords                     : mykeyword1
Subject                         : mykeyword1
Last Keyword XMP                : mykeyword1


As you can see, my keyword is stored in 3 different variables. Problem is, that image has 2 different keywords.

>exiftool DSC_0638.JPG | grep -i mykeyword2
>

So, my second keyword is not stored anywhere in the output of exiftool. Maybe I use a wrong command ?

Important detail: the second keyword is shown when using Finder/Get Infos. So it is there.

Thank you once again !

Phil Harvey

XMP Subject should show both keywords like this:

Subject                         : mykeyword1, mykeyword2

If it doesn't, then the second keyword isn't stored properly.

Try this just in case it is in a duplicate tag name somewhere else:

exiftool -G1 -a DSC_0638.JPG | grep -i mykeyword

- 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 ($).

mrhoward

Well somehow the JPG file I used for testing was bad.

I did tests with another JPG using several different IPTC keywords, and it worked like a charm, I got them as tags and everything works fine.

Thanks a lot for the help, Phil, highly appreciated and so fast ! You rock :-)