I'm using the config file below to rename & move files in a variety of situations depending on the date, time, and model tags in the files.
When I run it, if it finds a file without a model tag, it notes the error "Warning: [minor] Tag 'model' not defined" but does still properly name (with "Unknown" as the model placeholder in the file name) & move the file.
When I add in the -m option, it runs quietly, but instead of adding "Unknown" to the filename, it simply adds the "- " and leaves a blank model, as though ignoring the error is causing it to go ahead & execute the expression with the model tag - which is null since there's no model tag.
It's not a big deal to see the errors, of course, but I'm wondering whether it's possible still to use the -m option but also not execute the expressions with the model tag included (when there is no model tag, of course).
-r
-if
$filename =~ m/\(JSK\)/
-d
/Volumes/Io/staging/exiftool_testing/4-final/%Y/%Y-%m/%Y-%m-%d at %H-%M-%S
-filename<$filecreatedate - Unknown (JSK)%-c.%e
-filename<$filecreatedate - ${model;s/\//-/} (JSK)%-c.%e
-filename<$createdate - Unknown (JSK)%-c.%e
-filename<$createdate - ${model;s/\//-/} (JSK)%-c.%e
-filename<$datetimeoriginal - Unknown (JSK)%-c.%e
-filename<$datetimeoriginal - ${model;s/\//-/} (JSK)%-c.%e
-filename<$datetimeoriginal.${subsectimeoriginal;$_='0'x(3-length).$_} - Unknown (JSK)%-c.%e
-filename<$datetimeoriginal.${subsectimeoriginal;$_='0'x(3-length).$_} - ${model;s/\//-/} (JSK)%-c.%e
-ext+
AVI
/Volumes/Io/staging/exiftool_testing/9-testing
Just pointing out this is not unexpected behavior. From the docs on the -m (-ignoreMinorErrors) option (https://exiftool.org/exiftool_pod.html#m--ignoreMinorErrors)
Note that this causes missing values in -tagsFromFile, -p and -if strings to be set to an empty string rather than an undefined value.
You could try something like adding s/^$/Unknown/ (e.g. ${model;s/\//-/;s/^$/Unknown/}) to convert an empty string to Unknown.
<facepalm> missed seeing that in the docs - that's perfect, thanks.