Expression help

Started by lnjustin, January 30, 2023, 09:44:49 AM

Previous topic - Next topic

lnjustin

I'm trying to add the file size to the filename along with date information. Here's my command, but I don't think I can mix the file size expression in with the date this way. How do I make this work?

/usr/local/bin/exiftool -d /Volumes/Test/%Y/%m/%Y-%m-%d_at_%Hh%Mm%Ss_$filesize#.%%e -overwrite_original '-filename<filemodifydate' '-filename<DateCreated' '-filename<CreateDate' '-filename<DateTimeOriginal' '-filemodifydate<DateCreated#' '-filemodifydate<CreateDate#'  '-filemodifydate<DateTimeOriginal#' /Volumes/Test/020125CC-5DF2-4E38-B4A5-789F5BF54E3D.heic

I also tried with quotes but that didn't work either.
/usr/local/bin/exiftool -d '/Volumes/Test/%Y/%m/%Y-%m-%d_at_%Hh%Mm%Ss_$filesize#.%%e' -overwrite_original '-filename<filemodifydate' '-filename<DateCreated' '-filename<CreateDate' '-filename<DateTimeOriginal' '-filemodifydate<DateCreated#' '-filemodifydate<CreateDate#'  '-filemodifydate<DateTimeOriginal#' /Volumes/Test/020125CC-5DF2-4E38-B4A5-789F5BF54E3D.heic

I'm running this on a mac.

Phil Harvey

Try this:

/usr/local/bin/exiftool -d /Volumes/Test/%Y/%m/%Y-%m-%d_at_%Hh%Mm%Ss -overwrite_original '-filename<${filemodifydate}_${filesize#}.%e' '-filename<${DateCreated}_${filesize#}.%e' '-filename<${CreateDate}_${filesize#}.%e' '-filename<${DateTimeOriginal}_${filesize#}.%e' '-filemodifydate<DateCreated#' '-filemodifydate<CreateDate#'  '-filemodifydate<DateTimeOriginal#' /Volumes/Test/020125CC-5DF2-4E38-B4A5-789F5BF54E3D.heic

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lnjustin