Combining commands with multiple renaming options

Started by slickdawg, October 20, 2021, 12:47:48 PM

Previous topic - Next topic

slickdawg


I have a few commands combined into one, and this command is working exactly like I want it:

1) set the file date/time according to the metadata
2) name the file DateTimeOriginal_Model.jpg    [ for cameras that do not have subseconds stored in the metadata (typically older cameras) ]
3) name the file DateTimeOriginal_subsectimeoriginal_Model.jpg [ for cameras that do have subseconds available in the metadata ]

exiftool "-FileModifyDate<DateTimeOriginal" '-filename<${DateTimeOriginal}_${Model;tr/ /_/}.jpg' '-filename<${DateTimeOriginal}_${subsectimeoriginal;$_.=0 x(3-length)}_${Model;tr/ /_/}.jpg' -d %Y%m%d_%H%M%S%%-c -ext jpg -r -v /tmp/dir


I've been running another command to identify the files "contaminated" by the Microsoft Windows Photo Viewer

exiftool -if '$Software=~/Microsoft/' -Filename=%f_Microsoft.%e -ext jpg -r -v /tmp/dir


I have not been able to combine these two commands into one thus far.  Is this even possible with the file renaming going on in the first command?  I'm thinking this will likely have to stay as two separate commands.

StarGeek

Yes, it will have to be two separate commands.  The -if option will negate the commands that you want to do for every file if it returns false.

Technically, you could combine the commands using the -execute option and -Common_Args option, but it won't save you any time.  Exiftool will still have to make two runs over all the files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

slickdawg