ExifTool Forum

ExifTool => Newbies => Topic started by: movingphotos on February 01, 2022, 11:10:07 PM

Title: Moving images based on IPTC fields
Post by: movingphotos on February 01, 2022, 11:10:07 PM
Hello

I'm having a bit of a difficult time wrapping my head around exiftool.
I'm ok to understand moving images based on dates and times and preset folders, but I wish to have a script moving images based on IPTC fields.

I use these fields in PhotoMechanic

Title/Object Name
Job ID/Trans Ref
Special Instructions
Category



CaptureOne automatically outputs these variables and I'm happy...Lightroom however...well Adobe decided not to I guess.



Is there a way to utilise the fields to get exiftool to do this?

exiftool '-Directory<CreateDate' -d /volumes /ISSUED/%Category%/%yyyy%/%JobID%/%Special Instructions/%Title% -r /media/desktop/output

I just don't understand how to get the variables from the IPTC fields into something exiftool can use :(

On a Mac if syntax matters.
Title: Re: Moving images based on IPTC fields
Post by: StarGeek on February 02, 2022, 12:07:02 AM
You have to separate them out from the -d (-dateFormat) option (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) format string.  Find the exact tag name you want to use (see FAQ #3 (https://exiftool.org/faq.html#Q3)) and insert that at the correct spot with a leading dollar sign.  It's more obvious with the copying tags examples, but renaming is just copying to the Filename/Directory pseudo tags.

Using your example.
exiftool -r -d %Y '-Directory</volumes/ISSUED/$Category/$CreateDate/$JobID/$SpecialInstructions/$ObjectName' /media/desktop/output

Further reading: -TagsFromFile option (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT), Writing "FileName" and "Directory" tags (https://exiftool.org/filename.html)