-IF file has data in tag data processes it

Started by nyxtyr, March 27, 2021, 12:28:06 AM

Previous topic - Next topic

nyxtyr

Working on a script to clear specific tags from files and want to loop it but I ran in to a problem where it keeps processing the files already processed. Below is what I have so far and it's working perfect with the exception it keeps processing files that don't have any data in the comment or title tags. I am trying to do something like "-if comment or title has data process it if not move to the next file"


:cleantime
C:\Users\encoder\Desktop\test\exiftool.exe -comment""= -title""= C:\Users\encoder\Desktop\test\* -r -ext mp4 -overwrite_original
timeout /t 60
goto cleantime

StarGeek

Try
exiftool.exe -r -ext mp4 -overwrite_original -if "$Comment or $Title" -comment= -title= C:\Users\encoder\Desktop\test\

If either the Comment or Title tag exists, then exiftool will clear both of them.  The asterisk at the end of the filepath is useless when you are using the -r (-recurse) option, see Common Mistake #2.
"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

nyxtyr

Works like a charm. Tested a few times and working perfect so far.