Filenaming Presets
Note: This article appears on the Focal Press site, and a version of it also appears Inside Lightroom 2:The serious photographer’s guide to Lightroom efficiency, which is published on October 29th in the US and November 9th in the UK
With image libraries getting bigger all the time the need to rename files just to keep up with the numbers is increasingly important.
Fortunately, the renaming scheme in Lightroom is very powerful, so you are able to create custom, token-based naming systems with ease.
As you can see from the diagram, you are able to use a combination of text and tokens for your naming system.
The above example shows a renaming scheme I use for my Keeper files from one of my cameras, the Canon EOS 400D. The sequence is:
400D_<Sequence # (00001)>_<Date (YYYY)>.<Date (MM)>.<Date (DD)><suffix>
which equates to
400D_00001_2008.09.10.dng
This will give a naming system that will last for 99,999 images (this is the maximum allowable under this token based system), which you would think would be enough! But imagine you are a photographer such as Vincent Laforet, who recently shot the Beijing Olympics. He returned with 28,444 images see http://tinyurl.com/57k6ny 3.5 shoots of that magnitude and you run out of numbers.
You could approach this with a manual hack and add an extra number at the beginning of the token, so that now the dialog box would look like this.
400D_0<Sequence # (00001)>_<Date (YYYY)>.<Date (MM)>.<Date (DD)><suffix>
which equates to
400D_000001_2008.09.10.dng
And this system will give you up to 999,999 images, enough for 35 Olympic-sized shoots without further manual intervention. Because when you then hit 1,000,000 images, you will have to manually change the sequence again.
It would be so much easier if this could be done automatically. By editing the Preset in a text editor we can achieve this.
So, to begin this process you will need a text editor, Notepad on Windows, or TextWrangler on the Mac are ideal (you need a plain text editor rather than a rich text editor.
Next you will need to locate your Filename Templates folder, these are stored in the following locations:
Mac: ~/Library/Application Support/Adobe/Lightroom/Filename Templates
XP: C:\Documents and Settings\<username>\Application Data\Adobe\Lightroom\Filename Templates
Vista: /AppData/Roaming/Adobe/Lightroom/Filename Templates
On Windows these may be in protected locations, so you will need to show all files to reach these folders.
Inside the Filename Templates folder there will be the custom naming preset, in this case 400D Keepers Name Structure.lrtemplate. Open this file in your text editor and you will see what a Filename Template looks like!
This file is a Lua Script file, Lua is the open source scripting language that is used for a lot of front end communication in Lightroom), unlike, say, an XMP file which is written in XML, this has more of a programmers’ procedural language structure about it, but don’t let that put you off, it is not too hard to work out what is meant in the file.
If we look at the main section of the file we will see some familiar terms; they are the Lua equivalent of our tokens that we created in the Rename editor in Lightroom.
"400D_",
{
value = "naming_sequenceNumber_5Digits",
},
"_",
{
value = "date_YYYY",
},
".",
{
value = "date_MM",
},
".",
{
value = "date_DD",
},
Each of the tokens is expressed as ‘value = “XX”’ and each of the text-based objects is simply “quoted”.
The one token that interests us here is the one that says:
value = "naming_sequenceNumber_5Digits",
Simply change this to:
value = "naming_sequenceNumber_9Digits",
and save the file. Note that if you want to retain your old Preset you will have to change the following items in the file as well, or there will be a clash.
Change
name = "Keepers Name Structure",
presetType = "Naming",
},
"AgTokenPresets",
"restoreTokenFromArchivedState",
},
internalName = "400D Keepers Name Structure",
title = "400D Keepers Name Structure",
to the following
name = "Keepers Extended Name Structure",
presetType = "Naming",
},
"AgTokenPresets",
"restoreTokenFromArchivedState",
},
internalName = "400D Keepers Extended Name Structure",
title = "400D Keepers Extended Name Structure",
Then save the file as: 400D Keepers Extended Name Structure.lrtemplate
Open or restart Lightroom, select a file in the Library, press F2, or select Library > Rename Photos…. In the resulting dialog, select 400D Keepers Extended Name Structure and you will see that we can now rename with up to 9 digits.
So this small change to a Presets allows us to happily rename up to 999,999,999 images, or 35,156 Olympic shoots!





