ExifTool Forum

ExifTool => Newbies => Topic started by: PiE81 on November 03, 2019, 12:24:52 PM

Title: run exiftool in a script (OSX)
Post by: PiE81 on November 03, 2019, 12:24:52 PM
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
Title: Re: run exiftool in a script (OSX)
Post by: Hayo Baan on November 03, 2019, 01:33:48 PM
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.
Title: Re: run exiftool in a script (OSX)
Post by: PiE81 on November 04, 2019, 03:22:56 AM
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