ExifTool Forum

ExifTool => Newbies => Topic started by: Lars on July 09, 2014, 02:26:45 PM

Title: Multiple commands in one?
Post by: Lars on July 09, 2014, 02:26:45 PM
Hi!

At the moment I execute both of this commands in each folder to rename jpg and mov files. Is there a way to work more efficient and combine the commands to one? (Mac osx)

exiftool -ext JPG '-FileName<CreateDate' -d "%a %d %b %Y %H.%M%%-c.%%le" .
exiftool -ext MOV '-FileName<FileModifyDate' -d "%a %d %b %Y %H.%M%%-c.%%le" .

Thanks!  :)
Title: Re: Multiple commands in one?
Post by: Phil Harvey on July 09, 2014, 05:21:21 PM
This is easier than people seem to think.  Here is the combined command:

exiftool -ext JPG -ext MOV '-FileName<FileModifyDate' '-FileName<CreateDate' -d "%a %d %b %Y %H.%M%%-c.%%le" .

The only trick is the order of the FileName arguments.  The last valid assignment takes precedence, so you want to copy CreateDate last since you want it to override FileModifyDate if available.

- Phil
Title: Re: Multiple commands in one?
Post by: Lars on July 10, 2014, 07:12:18 AM
Thanks for the quick answer!

But.. ;) it doesn´t seem to solve my problem. The reason I use FileModifyDate on MOV files is that the existing exif data for CreateDate is wrong, so I need to use CreateDate for JPG and FileModifyDate for MOV, to get everything correct.

I tried your solution but it picks CreateDate for both JPG and MOV (as you explained "- The last valid assignment takes precedence"). I can live happily with executing exiftool twice per folder, but it would be cool if it's possible to combine them to one.

/ L
Title: Re: Multiple commands in one?
Post by: orax on July 10, 2014, 08:50:28 AM
Maybe :
exiftool  -ext JPG '-FileName<CreateDate' -execute  -ext MOV '-FileName<FileModifyDate' -common_args -d "%a %d %b %Y %H.%M%%-c.%%le" .
Title: Re: Multiple commands in one?
Post by: Phil Harvey on July 10, 2014, 09:28:41 PM
Thanks Orax.  That is exactly what I would have suggested.

- Phil
Title: Re: Multiple commands in one?
Post by: Lars on July 11, 2014, 12:14:49 PM
Thanks orax,

That command works perfect!  :D

/ L