Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Request: Please add 'Filename number suffix' Metadata Token in Publisher
Offline
Hi Rob, I've added some tokens for this in the working Backlight code. After doing so I found that it's actually possible to do now in either CE4 or Backlight, using LUA expressions.
For example, if you have a Photo with filename such as Photo_00123.jpg, the following token will output 123:
{LUA=if Filename ~= "" then return string.match(Filename, '[1-9][0-9]*$') end}
The following token will output 00123:
{LUA=if Filename ~= "" then return string.match(Filename, '[0-9]+$') end}
The rule for both of those lines of code is that any digits at the end of the filename excluding extension will be output. So it should work with Filenames such as: Photo123.jpg, Photo-123.jpg, Photo_123.jpg, Photo000123.jpg, etc.
Is that what you're looking for?
Offline
Further to the above, the output from the above lines of code will be achievable with the simpler tokens {NumericFilenameSuffix} and {NUMERICFILENAMESUFFIX} with the next update to Backlight.
Offline
Thanks Ben, that's great.
I tried putting the LUA code in the Metadata Token box in Lightroom, and uploaded the template. It still shows the filename. Do I need to change something in the Client Response Setup>Image Info section, too? Thanks.
Offline
Hi Rob, have you republished the photos? That's the only way the backend can get the updated metadata.
Make sure that you select the Publisher setting 'Push metadata without updating existing photos' so that the republishing is speedy.
Offline
Sweet! It works. Thanks Ben.
Offline
Excellent! We have Jeffrey Friedl to thank for his excellent code behind the metadata handling.
Offline