run exiftool in a script (OSX)

Started by PiE81, November 03, 2019, 12:24:52 PM

Previous topic - Next topic

PiE81

Dears,
I need to set date and time from filename for some thousand of JPG.

I created a test.sh adding the following lines;

exiftool -datetimeoriginal "IMG_20180310_222155.jpg"
exiftool "-datetimeoriginal<filename" "IMG_20180310_222155.jpg"
exiftool -datetimeoriginal "IMG_20180310_222155.jpg"
..

But running ./test.sh in terminal (OSX), I get Error: File not found.
What am I doing wrong? If I execute each line one per time it works.

Thank you

Hayo Baan

Are the files in the same directory as the script? If not, make sure you specify the full path. If this isn't the problem, please provide us with the exact error message.

Also, instead of running exiftool on individual files, you can run exiftool on a selection of files/directories. This will be much faster.
E.g. exiftool '-datetimeoriginal<filename' -r -ext JPG DIR will run the command on all JPG files in DIR and its subdirectories.
Hayo Baan – Photography
Web: www.hayobaan.nl

PiE81

Yes, the JPGs were in the same directory of the script.
Anyway I solved using your unique command in place of the script.
Thank you