Need help with a specific file naming convention!

Started by nossaflex, January 13, 2022, 07:46:25 PM

Previous topic - Next topic

nossaflex

I have been searching and scouring for hours and this really is just not my thing. I'm just looking to rename my photos into a standard format. I've created the NOSSAFLISO convention as a general naming for all my files and I'm looking for a template to rename files into. Just for context so you know what I need help with:

NO = Number (the number of the image output by the camera - or shutter count will do!)
SS = Shutter Speed
A = Aperture
FL = Focal Length
ISO = ISO Value


For example:

IMGP2316.JPG

into

NO2316_SS1/100_A5.6_FL55mm_ISO200.jpg

And even if that's doable - remove the '1/' before the shutter speed and the 'mm' after the focal length!

Can this be done with exiftool? I can't for the life of me figure out how to implement multiple tags into renaming!!

Phil Harvey

The command could be something like this:

exiftool "-filename<NO${shuttercount}_SS${shutterspeed;s(1/)()}_A${aperture}_FL${focallength#}_ISO${iso}.%e" DIR

For this to work, all of the tags must be available (ShutterCount, ShutterSpeed, etc).

- 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 ($).

nossaflex

Phil you legend! That's perfect. I was so close with my attempts but my head was just going around in circles.

Is there a way to turn this into a mac application/script? Again I've tried for hours to no avail...

Thanks for taking the time to reply!

Hubert

Quote from: nossaflex on January 14, 2022, 11:48:06 PM

Is there a way to turn this into a mac application/script?



This AppleScript should do it:

set imageFolder to quoted form of POSIX path of (choose folder)
set baseETCommand to "usr/local/bin/exiftool '-filename<NO${shuttercount}_SS${shutterspeed;s(1/)()}_A${aperture}_FL${focallength#}_ISO${iso}.%e' " --nb space before double quote
set combinedCommand to baseETCommand & imageFolder
do shell script combinedCommand


It could be saved as a script application or rolled up into an Automator workflow. But the details may be a bit off scope for this forum...

nossaflex

Thanks Hubert! I know it's not specifically related to this forum and definitely out of scope. I'll give your code a try.

Thanks for taking the time to reply!