I have been trying to us a time range for datetimeoriginal plus one other tag to selectively apply an entry to the Event tag. For example:
exiftool -r -if '($DateTimeOriginal ge "2024:01:27 18:59:00" and $DateTimeOriginal lt "2024:01:27 23:59:00" and $Make eq "Nikon Corporation")' -Event="Alice Ted Reception" *.jpg
As written the command does not work. If I remove the and $Make eq "Nikon Corporation") section the command completes okay.
How would I restate the if condition to get this to work? Can it be restated?
Thanks.
It works correctly here after I swap the quotes for my Windows CMD
C:\>exiftool -G1 -a -s -DateTimeOriginal -make -event y:\!temp\Test3.jpg y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
[ExifIFD] DateTimeOriginal : 2024:01:27 15:00:00
[IFD0] Make : Nikon Corporation
======== y:/!temp/Test4.jpg
[ExifIFD] DateTimeOriginal : 2024:01:27 22:00:00
[IFD0] Make : Nikon Corporation
2 image files read
C:\>exiftool -r -if "($DateTimeOriginal ge '2024:01:27 18:59:00' and $DateTimeOriginal lt '2024:01:27 23:59:00' and $Make eq 'Nikon Corporation')" -Event="Alice Ted Reception" y:\!temp\Test3.jpg y:\!temp\Test4.jpg
1 files failed condition
1 image files updated
C:\>exiftool -G1 -a -s -DateTimeOriginal -make -event y:\!temp\Test3.jpg y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
[ExifIFD] DateTimeOriginal : 2024:01:27 15:00:00
[IFD0] Make : Nikon Corporation
======== y:/!temp/Test4.jpg
[ExifIFD] DateTimeOriginal : 2024:01:27 22:00:00
[IFD0] Make : Nikon Corporation
[XMP-iptcExt] Event : Alice Ted Reception
2 image files read
What command line/OS are you using? Are you sure that the DateTimeOriginal and Make tags exist in the file?
What is the exact output from your command?
Dumb mistake on my part. The Make value should have been in all caps i.e. NIKON CORPORATION in my command.
Thanks for replying. Knowing the command should work basically lead me to my error.