exiftool with mac os Automator

Started by lobe.red, September 14, 2021, 03:24:43 AM

Previous topic - Next topic

lobe.red

I would like to use the MacOs automator to edit photo files.
For example, remove metadata (camera data), add others (photographer), etc.
With the automator quick action (right click in finder) this can be used well.
However, using a shell script (can be inserted in Automator,) I am not able to use additional variables.
For example, I want to use the photographer or image name via a "Ask for text" dialog (works too, but the variable is not usable in the script, at least I don't know how.
Is there a solution of an automator or shell expert for this?

/usr/local/bin/exiftool -P -'Filename<DateTimeOriginal' -d "Holiday"'_%Y-%m-%d_%H-%M-%S.%%e' "$@"

>>works fine but i want a Variable for the string "Holiday" to be more flexible...

StarGeek

Have you searched these forums?  There are a lot of Automator examples.   
"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

lobe.red

MacOS 10.15.7
I want to change *.jpg files
I found no solution at those forums

Hubert

Getting and setting variables in Automator is somewhat counter-intuitive and clunky, as well as being a bit outside the scope of this forum. But what you want is quite possible.

Essentially you chain Set Value of Variable and Get Value of Variable actions together, and they will be passed to the Run Shell Script action as $1, $2 etc.

You must change the "Pass Input" option in the Run Shell Script action from to stdin to as arguments.

Suppose I want to set or change a lens tag. My first variable is a file path and my second variable is the result of an Ask for Text action, so my Run Shell Script action would be:

/usr/local/bin/exiftool $1 -lens=$2

Hope that helps...




lobe.red

Thank you for the tipps.

I have almost done it, but the file list contains the names twice. I do not know why.
No idea where they come from twice

Hubert

#5
By default ExifTool creates backups unless you add an -overwrite_original tag to your command.

Edit:

This is a problem with your Automator workflow, not an ExifTool issue.

In your Nach Text fragen action, click the Optionen button and check the German equivalent of "Ignore this action's input".