Efficiency with Automator on the mac

Started by aubreyff, January 10, 2014, 09:45:39 AM

Previous topic - Next topic

aubreyff

Hi,

I have a workflow/app that is working in that I made with Automator. It runs a shell script bin/bash:

for f in "$@"
do
    exiftool -photoshop:all= -tagsfromfile @ "-all:all<-photoshop:all" "$f"
    exiftool -exififd:all= -tagsfromfile @ "-all:all<-exififd:all" "$f"
    exiftool -xmp-aux:all= -tagsfromfile @ "-all:all<-xmp-aux:all" "$f"
    exiftool -xmp-crs:all= -tagsfromfile @ "-all:all<-xmp-crs:all" "$f"
    exiftool -xmp-photoshop:all= -tagsfromfile @ "-all:all<-xmp-photoshop:all" "$f"
    exiftool -xmp-xmp:all= -tagsfromfile @ "-all:all<-xmp-xmp:all" "$f"
    exiftool -xmp-xmpmm:all= -tagsfromfile @ "-all:all<-xmp-xmpmm:all" "$f"
    exiftool -exif:all= "$f"
    exiftool -rsrc:all= "$f"
    exiftool -xmp:dateTimeOriginal="2014:01:01 20:06:34.33-05:00" "$f"
    exiftool "-copyright=Copyright 2014 This is my picture!" "$f"
    exiftool -delete_original! "$f"
done


It works perfectly, but I am trying to make this script more efficient. Right now it seems to be making a lot of exiftool calls and I was hoping to make fewer, hopefully one or two.

Aubrey

Phil Harvey

Hi Aubry,

Yes, why not combine this into a single command?:

exiftool -photoshop:all= -exififd:all= -xmp-aux:all= -xmp-crs:all= -xmp-photoshop:all= -xmp-xmp:all= -xmp-xmpmm:all= -exif:all= -rsrc:all= -tagsfromfile @ -photoshop:all -exififd:all -xmp-aux:all -xmp-crs:all -xmp-photoshop:all -xmp-xmp:all -xmp-xmpmm:all -xmp:dateTimeOriginal="2014:01:01 20:06:34.33-05:00" "-copyright=Copyright 2014 This is my picture!" -overwrite_original "$f"

In your commands, arguments like "-all:all<-photoshop:all" don't make sense for 2 reasons:

1) The second "-" shouldn't be there.  So it should be "-all:all<photoshop:all"

2) The redirection is unnecessary, since redirecting to all:all is preserves the same family 1 group and tag name, which is just what -photoshop:all would do.

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

aubreyff

Wow,

That was easy.  :) I just had the syntax wrong in my attempts.

Thank you phil.

your friend,
Aubrey

Phil Harvey

Note that I just edited my command after you replied to fix problems in your original arguments.

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