How to reference a value in an -if statement

Started by imaginator, December 09, 2022, 12:42:55 PM

Previous topic - Next topic

imaginator

I have the following test (running from an args file if that makes any difference):

-d
%Y

-if
(not $xmp:Rights eq 'Copyright © '"'${DateTimeOriginal}'" Name, all rights reserved.')

...do something


I've tried different combinations of escaping #DateTimeOriginal but usually get back a message about
Condition: Can't find string terminator "'" anywhere before EOF -
I'd be most grateful if someone could point me in the right direction

StarGeek

This takes a bit of Perl knowledge.  The Concatenation Operator needs to be used.  Your args file would be
-d
%Y
-if
(not $xmp:Rights eq 'Copyright © '.${DateTimeOriginal}.' Name, all rights reserved.')
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

imaginator

Thanks. And much appreciated the comment about "...takes a bit of Perl knowledge". That makes me feel not so bad.  :)