Hallo,
in my ARG-File I have this code for testing:
-FileName<$QuickTime:CreateDate.%le
-d
%Y-%m-%d_%H-%M-%S%%-c
-if (($title) and ($datetimeoriginal))
-FileName<$QuickTime:CreateDate-${title;tr/ /_/}.%le
In the file there are no datetimeoriginal tag, so the condition failed. But at a result I get the filename "2017-11-21_12-44-43-test.m4v", the date with title instead of only the date while 1 condition failed.
Finaly I will check the quickTime:CreateDate, the datetimeoriginal is only for testing.
When I run the commandline exiftool -if "(($title) and ($datetimeoriginal))" "-FileName<$QuickTime:CreateDate-${title;tr/ /_/}.%le" FILE I get "1 files failed condition"
What goes wrong in the ARG-File?
Best regrads
It is one argument per line in the arg file, so it should look like this:
-FileName<$QuickTime:CreateDate.%le
-d
%Y-%m-%d_%H-%M-%S%%-c
-if
(($title) and ($datetimeoriginal))
-FileName<$QuickTime:CreateDate-${title;tr/ /_/}.%le
- Phil
Ah, thanks.
I tried this in different variations like:
-if
(($title) and ($datetimeoriginal))
-FileName<$QuickTime:CreateDate-${title;tr/ /_/}.%le
and
-if
"(($title) and ($datetimeoriginal))"
-FileName<$QuickTime:CreateDate-${title;tr/ /_/}.%le
and
-if
'(($title) and ($datetimeoriginal))'
-FileName<$QuickTime:CreateDate-${title;tr/ /_/}.%le
I get allways Error: File not found - '(($title) and ($datetimeoriginal))'
Any ideas?
Quant007
From the docs on the -if option (https://exiftool.org/exiftool_pod.html#if-NUM-EXPR)
Normal shell processing of arguments is not performed, which among other things means that arguments should not be quoted and spaces are treated as any other character.
I'm guessing there's a trailing space after -if. That means exiftool is looks for a tag called if(space), not the option if. As such, the if condition is no longer treated as the condition for the if and the only thing left is for it to be a filename.
Quote from: StarGeek on July 08, 2020, 11:30:37 AM
I'm guessing there's a trailing space after -if.
If you select the text as if you are going to copy/paste, you can see the space.
Thanks to all, the trailing space after -if was the problem
Now it works perfekt.