Hi, I am using Automator to automatically download photos from my memory card, then rename them, then move to an automatically created folder based on the EXIF date (that uses MetaDataMover action, which relies on EXIFTool).
In one of the steps I would like to automatically populate the IPTC title field with the filename of the image, because a) my camera doesn't populate it; b) my photo service for some reason doesn't auto populate it.
Right now, it works very well except for that title (I created it as a service, so I just right click on the files, choose the action and it does the rest).
Does anyone have either an automator action, or an applescript that they use to update any IPTC data with? I could use that as a basis for my automator flow. Thanks
Hi,
The following AppleScript should do what you want when run in a "Run AppleScript" Automator Action:
on run {input}
repeat with each_file in input
set each_file to each_file as alias
set posix_path to quoted form of (POSIX path of each_file)
set exif_command to "/usr/local/bin/exiftool " & posix_path & " -overwrite_original '-title<filename'"
do shell script exif_command
end repeat
return input
end runThe attached image shows it in context.
I suspect it's a MacOS thing, but if the IPTCCore (XMP) Title is set to the same as the file name, the Title doesn't appear in Finder info panels. It is displayed in the other apps I've tried it with (Apple Photos, GraphicConverter, Affinity Photo).
(I'm pretty sure that the older IPTC spec, listed at https://exiftool.org/TagNames/IPTC.html (https://exiftool.org/TagNames/IPTC.html), doesn't have a Title tag. The closest equivalent is probably Headline.)
Hope this helps.
EDIT: quick caveat. ExifTool creates a new file when it writes the tags. My script suppresses the
deletion retention of the originals using the -overwrite_original tag. The system file dates and times on the updated files will reflect the date and time that the script was run.)
Quote from: Hubert on September 27, 2020, 07:46:14 AM
(I'm pretty sure that the older IPTC spec, listed at https://exiftool.org/TagNames/IPTC.html (https://exiftool.org/TagNames/IPTC.html), doesn't have a Title tag. The closest equivalent is probably Headline.)
The IPTC IIM/Legacy equivalent is
IPTC:ObjectName. See here (https://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata#title), under the "IIM Specs" line.
Headline is the same name in both IPTC and XMP.
Quote from: Hubert on September 27, 2020, 07:46:14 AM
Hi,
The following AppleScript should do what you want when run in a "Run AppleScript" Automator Action:
on run {input}
repeat with each_file in input
set each_file to each_file as alias
set posix_path to quoted form of (POSIX path of each_file)
set exif_command to "/usr/local/bin/exiftool " & posix_path & " -overwrite_original '-title<filename'"
do shell script exif_command
end repeat
return input
end run
The attached image shows it in context.
I suspect it's a MacOS thing, but if the IPTCCore (XMP) Title is set to the same as the file name, the Title doesn't appear in Finder info panels. It is displayed in the other apps I've tried it with (Apple Photos, GraphicConverter, Affinity Photo).
(I'm pretty sure that the older IPTC spec, listed at https://exiftool.org/TagNames/IPTC.html (https://exiftool.org/TagNames/IPTC.html), doesn't have a Title tag. The closest equivalent is probably Headline.)
Hope this helps.
EDIT: quick caveat. ExifTool creates a new file when it writes the tags. My script suppresses the deletion retention of the originals using the -overwrite_original tag. The system file dates and times on the updated files will reflect the date and time that the script was run.)
Thanks Hubert! I modified the script based on Stargeek's info and it now works perfectly. My images now correctly have the filename embedded in the title.
Here's the fixed script:
on run {input}
repeat with each_file in input
set each_file to each_file as alias
set posix_path to quoted form of (POSIX path of each_file)
set exif_command to "/usr/local/bin/exiftool " & posix_path & " -overwrite_original '-ObjectName<filename'"
do shell script exif_command
end repeat
return input
end run
The full action now performs the following in one click:
- Moves the images from memory card to a folder on my hard disk in a temp folder
- Adds date prefix to the filename
- Adds the file name to the IPTC ObjectName field (title)
- Creates a dated folder in a destination folder on my disk (if doesn't exist already) based on the images downloaded. e.g. 2020-09 . This part of action uses MetaDataMover action (which uses ExifTool).
- Moves the images to the dated folder.
Then, Flickr Uploader looks at the parent folder for any changes and copies them up automatically.
Takes just a few seconds. Wonderful.
If you want to check out the full action, it is here (to make it work, you must install ExifTool, and MetaDataMover action)
https://www.dropbox.com/sh/f7yhm52hhcunfhw/AABDLeV5Ykg589U4Yl4CjweUa?dl=0