What are the semantics of multiple -filename options?

Started by catinthehat, February 16, 2017, 09:36:24 PM

Previous topic - Next topic

catinthehat

This command was in a hazel rule and I'm not sure what the multiple -filename options do:

exiftool -P -d '%Y%m%d' \
   '-filename<${FileModifyDate;}.%e' \
    '-filename<${GPSDateTime;}.%e' \
    '-filename<${MediaCreateDate;}.%e' \
    '-filename<${ModifyDate;}.%e' \
    '-filename<${DateTimeOriginal;}.%e' \
    "$1"


Does filename resolve to the date of the first attribute that the file actually has?

StarGeek

From the docs:
"If two assignments affect the same tag, the latter takes precedence..."

So the DateTimeOriginal assignment has the highest priority, FileModifyDate has the lowest.  If there isn't a DateTimeOriginal tag, then ModifyDate will be used.  If there isn't a DateTimeOriginal or ModifyDate tag, MediaCreateDate will be used, etc, etc.
* 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).

catinthehat

Thanks!  I also hadn't thought of filename as one of the tags.   I appreciate the quick and helpful reply.