.
Preset Templates in My Lightroom Plugins

Many of my plugins for Adobe Lightroom offer the ability to construct certain kinds of data dynamically, such as setting image titles when uploading photos to a remote site.

The rest of this page documents the template notation as it exists for the latest versions of the plugins running in the latest version of Lightroom. If something doesn't seem to work as documented, please make sure you're using the latest version of your plugin, via the check now button in the upper-right section of the Plugin Manager.


A template is a combination of prose and special tokens wrapped in { ... } that insert photo-specific items.

For example, the template

     Copyright {YYYY} {Artist}

includes the text “Copyright”, a space, the token YYYY (which stands for the year that the photo was taken), a space, and the Artist token (which stands for the value of the “Artist” metadata item).

For one of my photos taken in 2006, this example would become

   Copyright 2006 Jeffrey Eric Francis Friedl

Here is the list of tokens that are currently supported:

Photo Date
YYYY The year the photo was taken, as a four-digit string
YY The year the photo was taken, as a two-digit string
MM The month the photo was taken, as a two-digit string
DD The day of the month the photo was taken, as a two-digit string
HH The hour value for the time the photo was taken, in 24-hour notation, as a two-digit string
HH12 The hour value for the time the photo was taken, in 12-hour notation, as one- or two-digit string
AMPM The AM/PM designation for the time when the photo was taken
MIN The minute value for the time the photo was taken, as a two-digit string
SS The seconds value for the time the photo was taken, as a two-digit string
Mon The month the photo was taken, as a localized three-character string
Month The month the photo was taken, as a localized string
Date The day of the month the photo was taken, as one- or two-digit string
D1 The full date of the photo, in the system-localized short format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “2010-03-24”.
D2 The full date of the photo, in the system-localized medium format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “Mar 24, 2010”.
D3 The full date of the photo, in the system-localized long format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “March 24, 2010”.
T1 The full time-of-day of the photo, in the system-localized short format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “3:38 PM”.
T2 The full time-of-day of the photo, in the system-localized long format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “3:38:02 PM”.
PhotoDaysSince=date The number of days from the given date and the date of the photo. This is intended for use along the lines of My 2010 In Photos: Day {PhotoDaysSince=2009-12-31}

The date argument is in the form “YYYY-MM-DD” but may also have an appended time, in HH:MM 24-hour notation, to delimit when dates start. If you're a night-owl who might want to include a photo taken late in the evening, after midnight, as being part of the previous day, you might want to use something like My 2010 In Photos: Day {PhotoDaysSince=2009-12-31 04:00} to have photo taken until 4am be considered part of the previous day.

One concern to watch out for with this date/time example is that photos taken during the first four hours of Jan 1 2010 would appear to still be part of the previous day, day “0”.

PhotoDaysUntil=date Like PhotoDaysSince, but in the counting-down-until sense.
Current Date
yyyy The current year as a four-digit string
yy The current year as a two-digit string
mm The current month as a two-digit string
dd The current day of the month as a two-digit string
hh The current hour value, in 24-hour format, as a two-digit string
hh12 The current hour value, in 12-hour format, as a one- or two-digit string
ampm The current time's AM/PM designation
min The current minute value, as a two-digit string
ss The current seconds value, as a two-digit string
mon The current month, as a localized three-character string
month The current month, as a localized string
date The current day of the month, as one- or two-digit string
d1 The current full date, in the system-localized short format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “2010-03-23”.
d2 The current full date, in the system-localized medium format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “Mar 23, 2010”.
d3 The current full date, in the system-localized long format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “March 23, 2010”.
t1 The current full time-of-day, in the system-localized short format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “3:38 PM”.
t2 The current full time-of-day, in the system-localized long format that you can set in your operating system's preferences dialog. On my system this is something along the lines of “3:38:02 PM”.
DaysSince=date Like PhotoDaysSince, but measures the current date to the date (or date/time) given in the argument, without regard to any photo date. You might want to use this along with something like My 2010 In Photos: Day {DaysSince=2009-12-31} if you want to have the Day counter refer to when you do the upload, not when you took the shot. With this token, you'd want to use the date/time form if you're a night owl and want an upload done late in the evening, after midnight, to be considered as having been done the previous day.
DaysUntil=date Like PhotoDaysUntil, but in the counting-down-until sense.
Filenames and Paths
FullExportedFile The full path and filename of the exported copy
FullExportedFolder The full path to the folder of the exported copy
Filename The filename – without path and without extension – of the exported copy
FILENAME Like Filename, but includes the extension
FullMasterFile The full path and filename of the master image on disk
LibraryFilename The filename – without path and without extension – of the master file in the library (which is not necessarily the filename being generated for the exported copy)
LIBRARYFILENAME Like LibraryFilename, but includes the extension
FolderName The name of the folder (without path) in which the master image in the catalog resides
FolderPath The full path of the folder in which the master image in the catalog resides
Image
Filetype One of: “JPEG”, “RAW”, “DNG”, “TIFF”, “PSD”, “DNG”, or “Video”
OriginalWidth The width of the (possibly pre-crop) original master image (not the exported one), in pixels
OriginalHeight The height of the (possibly pre-crop) original master image (not the exported one), in pixels
Cropped Either “cropped” or “uncropped”.
CroppedWidth The width of the (possibly post-crop) library image (not the exported one), in pixels
CroppedHeight The height of the (possibly post-crop) library image (not the exported one), in pixels
AspectRatio This becomes “Portrait” if the cropped image is more tall than wide, “Square” if the cropped with and height are the same, and “Landscape” if wider than tall. You can substitute your own phrases for each by using the form {AspectRatio=X,Y,Z}, where X, Y, and Z are used for Portrait, Square, and Landscape, respectively.
Lens / Camera / Exposure
Aperture The photo's aperture value, formatted like “f/4.5”
ApertureNum The photo's aperture value, as a raw number
CameraMake The photo's “Make” metadata item in Lightroom's database.
CameraModel The photo's “Model” metadata item in Lightroom's database.
CameraName The Make and Model combined in a way that is natural to a reader. For example, if Make is “EASTMAN KODAK COMPANY” and Model is “KODAK XYZ123 ZOOM DIGITAL CAMERA”, CameraName is “Kodak XYZ123 Zoom”. I have a lot of camera-specific rules about how to combine the make and model sensibly, so if you find one for which I don't do a good job, please send me a sample image so that I can inspect its metadata.
CameraSerialNumber The photo's “Serial Number” metadata item in Lightroom's database.
Exposure The photo's exposure data, like “1/250 sec at f/5.0”.
ExposureBias The photo's exposure-bias setting, like “-1 EV”.
ExposureBiasNum The photo's exposure-bias setting, as a raw number.
ExposureProgram The photo's exposure-program setting, like “Aperture priority”.
Flash One of “no flash”, “flash fired”, or “unknown flash”.
FocalLength Focal Length, as a number
FocalLength35 Focal Length in 35mm format, as a number
FocalLength35MM Focal Length in 35mm format (with locale-specific “mm” appended)
FocalLengthMM Focal Length (with locale-specific “mm” appended)
ISO The photo's ISO (sensor sensitivity) number.
Lens The photo's lens information, like “24-70mm f/2.8”.
MeteringMode The photo's metering-mode setting, like “Pattern”.
ShutterSpeed The shutter speed, formatted like “1/60 sec”.
ShutterSpeedNum The shutter speed as a floating-point number of seconds; Use the “Places” filter to limit precision.
SubjectDistance The subject distance as reported by the lens, formatted like “1.2 m”. Often wildly inaccurate.
SubjectDistanceNum The subject distance as reported by the lens, as a floating-point number. Often wildly inaccurate.
Attributes
CopyName The name of the copy (master or virtual) being exported, if any
Rating The number of stars assigned to the image: “0” through “5”. You can also use with an argument, e.g. {Rating=*} or {Rating=great } to have, for example, a three-star photo result in “***” or “great great great”. In either case, a photo with a zero rating results in nothing, but you can combine tokens (as described below) along these lines: {Rating=*|"unrated"}.
FlagStatus This becomes “Pick” if the image is flagged as a pick, nothing if the image is not flagged, and “Rejected” if the image is flagged as rejected. You can substitute your own phrases for each by using the form {FlagStatus=X,Y,Z}, where X, Y, and Z are used for Pick, nothing, and Rejected, respectively. For example: “{FlagStatus=Super!,okay,no good}” or “{FlagStatus=,, (rejected)}
ColorLabel The “Label” metadata item
EditCount A number that goes up each time a change is made in Lightroom to the image or its data.
UUID Lightroom's internal unique identifier for the photo, an essentially-random 36-character sequence of letters, numbers, and hyphens, such as “FB4D3F92-455F-47CA-8B7B-7C885F7244FD”.
Location
GPSCoordinates The photo's geoencoded coordinates, like “35°1'11.51" N 135°46'16.05" E”
Altitude The photo's geoencoded altitude, as a number, in meters. Use “Places”, e.g. {Altitude:Places=0}, to limit precision.
GPSAltitude The photo's geoencoded as a description, e.g. “27.3 m
Latitude Latitude, as a floating-point number. Use “Places”, e.g. {Latitude:Places=4}, to limit precision.
Longitude Longitude, as a floating-point number. Use “Places”, e.g. {Longitude:Places=4}, to limit precision.
IfGeoencoded If used in the form {IfGeoencoded=some text here}, the token is replaced by the text after the “=” if the photo is geoencoded, or replaced by nothing if not. If used in the form {IfGeoencoded=some text here;for non-geoencoded} with a semicolon, the text after the semicolon is used when the photo is not geoencoded.
Location The “Location” metadata item
City The “City” metadata item
State The “State” metadata item
Province The “State” metadata item
Country The “Country” metadata item
CountryCode The photo's “Image > ISO Country Code” metadata item in Lightroom's database.
Other Metadata
Artist The “Artist” metadata item
Caption The “Caption” metadata string
Category The photo's “IPTC > Category” metadata item in Lightroom's database.
Copyright The “Copyright” metadata item
CopyrightUrl The photo's “Copyright Info Url” metadata item in Lightroom's database.
Creator The photo's “Contact > Creator” metadata item in Lightroom's database.
CreatorAddress The photo's “Contact > Address” metadata item in Lightroom's database.
CreatorCity The photo's “Contact > City” metadata item in Lightroom's database.
CreatorCountry The photo's “Contact > Country” metadata item in Lightroom's database.
CreatorEmail The photo's “Contact > E-Mail” metadata item in Lightroom's database.
CreatorJobTitle The photo's “Contact > Job Title” metadata item in Lightroom's database.
CreatorPhone The photo's “Contact > Phone” metadata item in Lightroom's database.
CreatorState The photo's “Contact > State / Province” metadata item in Lightroom's database.
CreatorUrl The photo's “Contact > Website” metadata item in Lightroom's database.
CreatorZip The photo's “Contact > Postal Code” metadata item in Lightroom's database.
DescriptionWriter The photo's “IPTC > Description Writer” metadata item in Lightroom's database.
Genre The photo's “Image > Intellectual Genre” metadata item in Lightroom's database.
Headline The “Headline” metadata item
Instructions The photo's “Workflow > Instructions” metadata item in Lightroom's database.
JobIdentifier The photo's “Workflow > Job Identifier” metadata item in Lightroom's database.
Keywords The list of the photo's marked-for-export keywords, separated by commas. (Actually, there's a comma+space pair between each keyword, so it's “plant, rose, flower” and not “plant,rose,flower”.)
KeywordsAll The same as Keywords, but also includes keywords not marked for export
IfKeyword If used in the form {IfKeyword=keyword;some text here}, the token is replaced by the text after the “=” if the photo has been tagged with the named keyword (even if that keyword is not marked in Lightroom as one to be exported). If no text is given after the semicolon, the keyword itself is used: {IfKeyword=public;} becomes “public“ or nothing.

If used in the form {IfKeyword=keyword;some text here;the not-keyworded text}, with an extra semicolon-separated phrase, the token becomes the not-keyworded if the photo is not tagged with the named keyword.

IfExportedKeyword Like IfKeyword, but considers only keywords that have been marked in Lightroom for export.
OtherCategories The photo's “IPTC > Other Categories” metadata item in Lightroom's database.
Provider The photo's “Workflow > Provider” metadata item in Lightroom's database.
RightsUsageTerms The photo's “Workflow > Rights Usage Terms” metadata item in Lightroom's database.
Scene The “Scene” metadata item
Software The photo's “Software” metadata item in Lightroom's database.
Source The “Source” metadata item
SubjectCode The photo's “IPTC > IPTC Subject Code” metadata item in Lightroom's database.
Title The “Title” metadata item
PersonShown The “Person Shown” metadata item
NameOfOrgShown The “Name of Organization Shown” metadata item
CodeOfOrgShown The “Code of Organization Shown” metadata item
Event The “Event” metadata item
AdditionalModelInfo The “Additional Model Info” metadata item
ModelAge The “Model Age” metadata item
MinorModelAge The “Minor Model Age” metadata item
ModelReleaseStatus The “Model Release Status” metadata item
ModelReleaseID The “Model Release ID” metadata item
ImageSupplierImageId The “Image Supplier ImageId” metadata item
SourceType The “Source Type” metadata item
PropertyReleaseID The “Property Release ID” metadata item
PropertyReleaseStatus The “Property Release Status” metadata item
DigImageGUID The “Digital-Image GUID” metadata item
PlusVersion The “Plus Version” metadata item
Online Presence
ExposureManagerUrl The url of the image at ExposureManager (only if previously uploaded with my Upload-to-ExposureManager plugin)
FacebookUrl The url of the image at Facebook (only if previously uploaded with my Upload-to-Facebook plugin)
PhotobucketUrl The url of the image at Photobucket (only if previously uploaded with my Upload-to-Photobucket plugin)
PicasawebUrl The url of the image at PicasaWeb (only if previously uploaded with my Upload-to-PicasaWeb plugin)
SmugMugUrl The url of the image at SmugMug (only if previously uploaded with my Upload-to-SmugMug plugin)
ZenfolioUrl The url of the image at Zenfolio (only if previously uploaded with my Upload-to-Zenfolio plugin)
FlickrUrl The url of the image at Flickr (only if previously uploaded with my Upload-to-Flickr plugin)
IpernityUrl The url of the image at Ipernity (only if previously uploaded with my Upload-to-Ipernity plugin)
TumblrUrl The url of the image at Tumblr (only if previously uploaded with my Upload-to-Tumblr plugin)
GoogleDriveUrl The url of the image at Google Drive (only if previously uploaded with my Upload-to-Google-Drive plugin)
OnlineID

Flickr plugin only. The Flickr ID of the image. This allows you to create a description preset along the lines of:

<a href="http://BigHugeLabs.com/flickr/onblack.php?id={OnlineID}">View on Black</a>

which creates a result at Flickr like this, which includes a link with this result.

Export Type
ExportFormat The kind of export file format being produced (JPEG, PSD, etc)
ExportQuality When the export format is JPEG, the quality setting (0 - 100)
ExportBitDepth When the export format is TIFF or PSD, the target bit depth (8 or 16)
ExportColorSpace When the export format is not DNG or ORIGINAL, the target color space (e.g. sRGB)
ExportSharpeningLevel The export-sharpening level setting (blank if sharpening is off, Low, Standard, or High)
ExportSharpeningMedia The export-sharpening media type (blank if sharpening is off, Screen, Matte Paper, Glossy Paper)
Publish
PublishCollectionName

The name of the publish collection via which an image is being processed, blank otherwise.

Due to how Lightroom's plugin infrastructure is built, supporting this properly is a real pain in the neck and I may have missed some situations. If you find it's not showing where you expect, please send me a note with a clear description of the situation.

PublishCollectionDepth

The depth of the publish collection via which an image is being processed. A publish collection at the root of its publish service gets “1”. A publish collection within a root-level publish collection set gets “2”, and so on.

Zero (“0”) if not within the context of a publish collection.

Due to how Lightroom's plugin infrastructure is built, supporting this properly is a real pain in the neck and I may have missed some situations. If you find it's not showing where you expect, please send me a note with a clear description of the situation.

PublishServiceTitle

The title of the overall publish service via which an image is being processed, blank otherwise.

Due to how Lightroom's plugin infrastructure is built, supporting this properly is a real pain in the neck and I may have missed some situations. If you find it's not showing where you expect, please send me a note with a clear description of the situation.

System
LrVersion The version of Lightroom running, such as 5.4
LrVersionMajor The major number of the Lightroom version, such as 5 for Lr5.4
LrVersionMinor The minor number of the Lightroom version, such as 4 for Lr5.4
LrVersionRevision The sub-minor number of the Lightroom version, usually 0.
LrVersionBuild The build number of the current Lightroom install (usually a six-digit number).
CatalogName The name of the current catalog (the filename without leading path and without the .lrcat extension).
CatalogPath The full path to the current catalog file.
OperatingSystem Either Windows or OS X
OS Either Win or Mac
Special
PluginProperty=field Allows you to access the per-image custom metadata kept by a plugin, where field is the plugin's id and the metadata field id, joined with a dot. For example,
{PluginProperty=info.regex.lightroom.export.flickr2.url}
refers to the url field of the plugin with id info.regex.lightroom.export.flickr2 (my Flickr plugin), and the result is the same as the {FlickrUrl} token mentioned above. However, with PluginProperty, you can reference any plugin data for which you know the plugin id and field name. You can get these from the plugin author, or try digging around the plugin's Info.lua for the plugin id and a reference to its LrMetadataProvider, where you can find field ids.
Empty An empty string, perhaps useful for testing. Also, when placed between joining characters, it blocks their squelching.
" text " The text as provided. It may not contain the following characters: {   |   }   "
- Inserts a hyphen that is never squelched; essentially the same as {"-"}
, Inserts a comma that is never squelched; essentially the same as {","}
LUA See the section below for details on this advanced, complex token.

Token Basics

As mentioned above, tokens are identified within a template by wrapping them with { ... }. The value generated by the token has leading and trailing spaces removed before being inserted into the result. For example, if the “Caption” metadata item is the string “My Vacation  ”, the value actually used for the Caption token (which appears as “{Caption}” in the template) is “My Vacation”.

Combining Tokens

You may list multiple tokens within { ... }, separated by | (a vertical bar). In such a case, the first token that results in non-empty text is used. Tokens may result in an empty value if the photo is missing the associated metadata. For example, if a photo is missing the “date taken” metadata, the YYYY token is empty. Thus, the previous copyright example may be better written as:

     Copyright {YYYY|yyyy} {Artist}

In this case, if the YYYY token is empty, the yyyy token (the current year, which can never be empty) is used.

Continuing with this example, because the Artist token results in an empty item if there is no artist metadata, this example might be written as:

     Copyright {YYYY|yyyy} {Artist|"by the photographer"}

to become

     Copyright 2008 by the photographer

when there is no artist metadata.

Token Filters

Filters allow you to modify the text that a token generates. For example, applying the S2U filter (“Space to Underscore”) to the “Caption” example given earlier results in a value of “My_Vacation”. To indicate that a filter should be applied to a token, append it to the token name with a colon. This example appears would appear in a template as “{Caption:S2U}”.

Token filters:

S2U Space to Underscore Any sequences of spaces (and/or underscores) are replaced by a single underscore
S2D Space to Dash Any sequences of spaces (and/or dashes) are replaced by a single dash
U2S Underscore to Space Any sequences of underscores (and/or spaces) are replaced by a single space
D2S Dash to Space Any sequences of dashes (and/or spaces) are replaced by a single space
DU2S Dash/Underscore to Space Any sequences of dashes, underscores, and/or spaces are replaced by a single space
NS No Spaces All spaces are removed
LO Letters Only All spaces and punctuation are removed, leaving only letters (and numbers)
Places=num specify numeric precision If the item is number, formats it to num decimal places. If the item is not a number, makes it empty.
Length=num specify max length If the item is longer than num characters long, it is truncated to the first num characters. Treats the text as UTF-8.
After=text Use value to the right of text

If the given text is found in the value that the token generates, strip it and all that appeared before (to the left), leaving only what appears to the right of text in the value. If the text is not found in the value, the result of the token is empty.

For example, if you tend to use captions like “My trip to Paris” and “My trip to the Canadian Rockies”, and you wanted shorter text, you might consider using {Caption:After=trip to} to result in values like “Paris” and “the Canadian Rockies”.

If you wanted to implement an idea such as “Strip the '...trip to' text from the caption if it's there, and use the unadulterated caption if not”, you would append an unadorned Caption token as described in the “Combining Tokens” section above, resulting in {Caption:After=trip to|Caption}.

UC Upper Case Capitalizes the item
UCFirst Upper Case (first character) Capitalizes the first character of the item.
UCWords Upper Case Words Capitalizes the first character of the item, and any character after a space or hyphen.
LC Lower Case Ensures the item is all lower case.
LCFirst Lower Case (first character) Lowers the case of the first character of the item.
EMBED Embed value and reparse

When used in the additional keywords section of an uploader plugin, causes the token to not be treated as a single unit, but subject to one more level of inspection.

For example, if your title metadata field has one two three (without quotes) and in the additional keywords field you put {Title}, the result is one additional keyword: one two three. However, if you use {Title:EMBED}, the result is three keywords: one, two, and three.

Squelching Superfluous Joining Characters

Within a template, joining characters are special:

  • space
  • comma
  • hyphen/minus
  • colon
  • the <br> and <br/> sequences

After a photo-specific value has been computed from a template, all leading and trailing joining characters are removed, and embedded repetitions are replaced by a single item.

As an example of the first case, consider

     Copyright {YYYY|yyyy} {Artist}

when there is no artist metadata. Without these special rules, this would result in the derived value having trailing space, but the special squelching rules remove it.

As another example, consider the template:

     {Location}-{Country}-{State}-{City}-{Caption}

for a photo that has “Location” and “Caption”, but no “Country,” “City,” or “State.”. Assuming that location and caption are “Home” and “Having Fun” respectively, it becomes:

     Home-Having Fun

which is better than it would be without these special rules:

     Home----Having Fun

Note that space, comma, and hyphen/minus are only special when they're part of the template itself. When they are part of the value derived from a token (such as the space in “Having Fun” above), they are never considered for squelching.

As such, you can use either {-} or {"-"} to include a hyphen/minus that will never be squelched. Similarly, you can use {,} or {","} for a comma.

The special {Empty} token

The {Empty} token produces no text, but has the side effect in that it interrupts the squelching of joining characters. Without it, the sequence <br><br> becomes <br> but with it, <br>{EMPTY}<br> becomes <br><br>”.

The special {NOJOINERS} token

As mentioned above, leading and trailing joining characters are stripped, but sometimes you want them stripped whenever they appear in a certain context. For example, the template

     <span class='where'>{City}, {State}</span>

results in something like “<span class='where'>Paris, </span>” if City is “Paris” but State has no value. In this case you'd like to mark the start and end of the <span> as being places where no joining characters should accumulate, just as they shouldn't accumulate at the start and end of the whole specification.

To do this, put the special {NOJOINERS} token in these spots, e.g.

     <span class='where'>{NOJOINERS}{City}, {State}{NOJOINERS}</span>

The exact rules for how joining characters are squelched are complex, but they are designed to produce a common-sense result. If you run into one that doesn't work as you'd like, let me know.

The Special {LUA=...} Token

This advanced programming-like feature allows you to execute arbitrary Lua code, in an environment where the tokens above have been prepopulated into variables. For example,

   {LUA=CreatorPhone}

and

   {LUA=return CreatorPhone}

are exactly the same as the {CreatorPhone} token, but, for example

   {LUA=  if  CreatorPhone ~= ''  then    return sprintf("Contact: %s", CreatorPhone)  end  }

becomes the string “Contact: text-from-CreatorPhone” if the CreatorPhone token is not empty, nothing if it is.

The special Lua environment, in the latest version of plugins running in the latest version of Lightroom, includes:

  • Variables exist for almost all of the tokens (except DaysSince, IfGeoencoded, etc. — tokens that require an extra argument). Each one is a string; if the token has no value, its variable in the special Lua environment is the empty string ''.

  • The Boolean locationIsPrivate, which is true if the photo is geoencoded and its location is within an area marked private in the Map Module, false otherwise. (Always false prior to Lr4.1.)

  • The standard Lua functions tonumber(), tostring(), type(), unpack(), ipairs(), and pairs().

  • The standard Lua name spaces string, table, and math. The os namespace is partially included: os.date(), os.time(), and os.tmpname().

  • The Lightroom SDK namespaces LrDate, LrPathUtils, and LrStringUtils. SDK docs can be downloaded here.

  • The Booleans WIN and MAC, which indicate the type of host operating system, and sprintf(), which is a synonym for string.format().

  • The function TBL(...), which returns a new table, populating it with any arguments provided. This is to help avoid curly braces in inlined Lua.

  • The function ne(item), meaning “non-empty”. It returns nil if the item is nil or tostring(item) evaluates to a zero-length string.

  • The function nb(item), meaning “non-blank”. It returns nil if the item is nil or tostring(item) evaluates to a string that has no non-whitespace characters.

  • The variable photoTime, which returns the Cocoa timestamp of the photo in question, if any. This is suitable for passing to Lightroom's LrDate.timestampToComponents() and LrDate.timeToUserFormat() functions, among others. Add 978307200 to get a Unix Time.

  • The variable currentTime, which returns the current Cocoa timestamp; identical to LrDate.currentTime().

  • The function date_diff(), which returns a string indicating the number of years/months/days separating its two arguments. Each argument can be a Cocoa timestamp like the photoTime or currentTime variables above, a string in the form "YYYY-MM-DD", or a table of numbers: {year, month, date, hour, minute, second}. The hour/minute/second are optional.

    For example, the following might be used to indicate the age of a child (born on October 22, 2009) as of the photo date: {LUA= "Aged " .. date_diff("2009-10-22", photoTime)}. For a photo taken Jan 1, 2013 it returns the string "Aged 3 years, 2 months, 10 days" on an English system.

    This does exactly the same thing: {LUA= "Aged " .. date_diff({2009,10,22}, photoTime)}

    There's actually a third argument to date_diff() that indicates a timezone in which to interpret dates provided via string or table like the two examples above. The default is the current timezone of the computer. If you provide a timezone, it should be as a number of seconds east of UTC.

  • A table KW that has keys for every keyword applied to the photo (the values are true), and a similar table KWE with keys for exported keywords. Thus, the code snippet KW.private is true if the keyword “private” has been applied to the photo, nil otherwise.

  • The function load(), which executes Lua code in a named file, as discussed below.

Here are some examples. Some have been broken into multiple lines for display, with pretty indenting, for easier reading one this page; when inputting into the plugin, you'll have to put it all on one big long (ugly) line....

  • {LUA=if Artist ~= “” then return sprintf(“Copyright %s”, Artist) end}
    Becomes “Copyright ....” with the name of the Artist if there is an Artist token.

  • {LUA=if Artist ~= “” and Copyright = “” then return sprintf(“Copyright %s”, Artist) end}
    Like the one above, but only if there is no Copyright token.

  • {LUA=if Artist ~= “” then return sprintf(“Copyright %s %s”, yyyy, Artist) end}
    Becomes “Copyright #### ....” with the current year and the name of the Artist, if there is an Artist token.

  • {LUA=if Artist ~= “” then
       if yyyy == YYYY or YYYY == “” then
          return sprintf(“Copyright %s %s”, yyyy, Artist)
       else
          return sprintf(“Copyright %s-%s %s”, YYYY, yyyy, Artist)
       end
    end}

    Like the one above, but the reference to the year in the copyright statement becomes a range if the photo has a date associated with it and that date is not the current year, e.g. “Copyright 2006-2010 Jeffrey Friedl” for a photo taken in 2006 and being processed in 2010.

  • {LUA=if Artist ~= “” then
       when = YYYY==yyyy or YYYY==“” and yyyy or YYYY..“-”..yyyy
       return sprintf(“Copyright %s %s”, when, Artist)
    end}

    Exactly like the one just above.

  • {LUA=if GPSCoordinates ~= “” then return sprintf(“geo:lat=%s;geo:lon=%s”, Latitude, Longitude) end}
    If the photo is geoencoded, becomes GPS machine tags.

  • {LUA=if KW.private and not KWE.private then return “private, but not reporting as such” end}
    Becomes “private, but not reporting as such” if marked with the keyword “private“, but that keyword is not marked for export.

Loading From a File

In Lightroom 3 and later, the load() function loads Lua code from a file. You can load a library of routines and then make reference to the routines later in the {LUA= ... }, or you can simply return the value of load(), which is the value returned at the end of the file:

   {LUA= return load("/full/path/to/your/lua/file.lua") }

This allows you to keep the tokens that appear in little plugin fields more manageable, yet lets you easily access arbitrarily-complex logic.

Real-World {LUA} Example

As one example, in my PicasaWeb (Google Plus, sort of) publish service for my “Selected Blog Photos” gallery on G+, I want the image caption to mention the url and title of the blog post that the photo was part of, and to mention the date of the blog post in English and Japanese. To do this, I created a file (“PicasaWeb.lua”) with this contents:


local Month = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }

function comment()
   if not JobIdentifier then
      return ""
   end

   --
   -- JobIdentifier should have one or more urls like "http://regex.info/blog/2012-06-09/2015"
   --
   -- Grab the date from the final one
   --
   local url = JobIdentifier:match(".*(http://%S+)")
   if not url then
      return ""
   end

   local Yx,Mx,Dx = url:match(".*blog/(20%d%d)%-(%d%d)-(%d%d)/")
   if not Dx then
      return ""
   end
   local rows = {
      sprintf("This photo appeared in an article on my blog on %s %d, %s.", Month[tonumber(Mx)], tonumber(Dx), Yx),
      sprintf("この写真は%d月%d日ブログの記事に載りました。",                     tonumber(Mx),  tonumber(Dx))
   }
   if Headline then
      table.insert(rows, sprintf('"%s"', Headline))
   end
   table.insert(rows, url)

   return table.concat(rows, "\n")
end

return comment()

and access it from a Caption preset in the plugin with this template token:

{LUA= load("/Users/jfriedl/Dropbox/Lightroom/LuaStuff/PicasaWeb.lua")}

Comments so far....

Would love the possibility of adding a line break :-)

— comment by Caroline on July 6th, 2008 at 2:10am JST (6 years, 2 months ago) comment permalink

I’m sorry for that question. Found out that I can use html in there. Very cute!

— comment by Caroline on July 6th, 2008 at 3:02pm JST (6 years, 2 months ago) comment permalink

Hi Jeffrey! Thanks for adding this great feature. A suggestion for an alternate syntax, perhaps better than the squelching–

{City “-”}{State|Province}

Right now the braces enclose a single token. Extending that to a sequence would allow for more general squelching, such as

{“©” YYYY “.” |”Image is in the public domain.”}

or using HTML for line breaks:

{Title “”}{Location “” City|City}

(If any token in the sequence were empty, then the whole sequence would fail for the alternative.)

On a practical level, I found some parsing bugs in version 46 (Lightroom 1.4.1):

– {Rating} doesn’t seem to work — it parses it as “{Rating” and complains of a missing closing brace
– Squelching multiple joiners is broken, such as in this case if there is no “State”:
{City}, {State}, {Country}

Hope that helps!

— comment by Peter Davis on July 8th, 2008 at 1:23pm JST (6 years, 2 months ago) comment permalink

Whoops, my second example should have been–

{Title “<br>}{Location “<br>” City|City}

— comment by Peter Davis on July 8th, 2008 at 1:24pm JST (6 years, 2 months ago) comment permalink

I’m like Caroline at her first comment: I’d love to be able to add a line break, but can’t figure it out, even by experimenting some HTML here and there… What is the correct syntax?

Whether you can send HTML depends on the destination (e.g. Flickr, Zenfolio, etc.). The ones that I know allow HTML have an option nearby the preset pulldown that lets you choose whether the text you write should be interpreted as html or as plain text. The others, as far as I know, allow only plain text. (Let me know if I’ve made a mistake with one.) —Jeffrey

— comment by Guillaume Lemoine on August 3rd, 2008 at 9:05pm JST (6 years ago) comment permalink

Using LR2 with the latest Flickr plugin. I’m getting two problems:
- The indicated line break doesn’t work
- I lost field customization. Even I update the preset, data is lost after restarting LR

Regards

I’m not sure what you mean by “indicated line break”, but about the preset data being lost, I’ve heard of that in one other case, and have no idea why it does that. Do presets for the standard export-to-disk export also reset, or is it limited to my plugins? —Jeffrey

— comment by Jose-Miguel on August 14th, 2008 at 3:56am JST (6 years ago) comment permalink

Jefrey, thanks for the reply.
By “indicated line break” I refer to the requested/commented possibility to include a line break in the title or description preset. I’ve not been able to add.

Regarding to preset data being lost, I just updated to your latest version plugin. Now the preset is working as expected (preset template is not lost, and available every time). Looks it’s solved.

— comment by Jose-Miguel on August 17th, 2008 at 4:38pm JST (6 years ago) comment permalink

The tokens are a great aspect of your very useful Lightroom plugin. I would like to be able to use the same tokens in the tags for the photo, is that possible?

It’s on the to-do list…. —Jeffrey

— comment by Lars Plougmann on August 18th, 2008 at 3:18am JST (6 years ago) comment permalink

Hello,

Thanks for your great plugins. I would like to know if there are/will be tokens for capture time and month of the year, I.E. Dec, December?

Thanks a bunch,

Gonzalo

Added in versions as of Aug 29. —Jeffrey

— comment by Gonzalo on August 30th, 2008 at 2:53am JST (6 years ago) comment permalink

Hellow,

Awesome plugin. Many thanks. Not sure whether to post this here or in your Metadata Preset post…

Is it possible to include the plugin metadata from your Flicker plugin (‘Uploaded to Flickr’ and ‘At Flickr’) in a custom metadata preset panel? I would love to include those in my custom preset. I am comfortable editing the preset file, just not sure of the values to include.

Thanks again for some AWESOME tools.

It’s on my (long) to-do list to update the metadata-preset-builder to allow this, but if you want to edit by hand, try info.regex.lightroom.export.flickr2.uploaded and info.regex.lightroom.export.flickr2.url —Jeffrey

— comment by Brian Burns on September 1st, 2008 at 7:40am JST (6 years ago) comment permalink

This is brilliant, almost reason enough to upgrade to LR 2 :)

However, I’m having a problem that I also had with previous versions – I simply can’t create empty titles! :)

Maybe this is a problem with the flickr api, but if a photo doesn’t have a suitable title, I like to use the empty string. I definitely don’t want the filename. I tried this template:

{Title|Headline|””}

But according to the preview that seems to result in the filename. This one also:

{Title|Headline}

I found that the preview was correctly empty if I used

{Title|Headline|Empty}

but when the images were uploaded to flickr, they had the filename as their title. Is it possible to change this?

Thanks a bunch for giving out these great tools!

cheers,
Arnar

— comment by Arnar on September 3rd, 2008 at 4:02am JST (6 years ago) comment permalink

Is there a way to use templates in Flickr:Upload Destination to create a New Set? For e.g., I would like to use {Folder} for the “New set name”.

Thanks.

Yes, click on the “auto dests” button (“automatic destinations”) and create a destination that uses {Folder}. —Jeffrey

— comment by Nitin on September 13th, 2008 at 5:06am JST (6 years ago) comment permalink

Very nice to be able to go beyond title and caption. Are more tokens in the works to be added for other camera EXIF data beyond Focal Length? Only personally interested in Exposure (w/aperture) and ISO Speed Rating, but others might want more.

I added a bunch of these today (Sep 14). —Jeffrey

— comment by M.Rathmann on September 14th, 2008 at 12:25am JST (5 years, 11 months ago) comment permalink

Great plugin. I still cannot figure out however how to insert newline in Flickr caption. At the moment all I can do is enter one long string (BTW the ‘Description Presets’ popup window does try to resize to fit this long string and ends up being wider than my screen). What I would like to achieve is a nicely formatted block of text. My template is as follows

{City}, {Country} {Month} {YYYY} • {Copyright} • {CameraModel} • {Exposure}, ISO {ISO}, {ExposureBias}, {ExposureProgram}, {MeteringMode}, {Flash} • {Lens} @ {FocalLengthMM} • {Caption}

I would like to have a newline instead of • character. When I hit Enter key, the dialog window closes. Shif-Enter, Control-Enter does not work. Yet, when editing caption in Flickr, all I have to do is hit Enter key. Am I doing something wrong? Am I overlooking something simple? Please help.

— comment by yOOrek on September 19th, 2008 at 7:20am JST (5 years, 11 months ago) comment permalink

This is a really really great feature. Thank you!

— comment by me on September 20th, 2008 at 12:16am JST (5 years, 11 months ago) comment permalink

The new ability to use these tokens in the keyword tag section is brilliant.

I’d like to suggest two additional tokens:

1. Flag status (pick or reject)

2. Rating as a repeated sequence of characters, ideally user specified. E.g. if the rating is 3, the generated tag is •••
This would be useful in many contexts where search capabilities are limited, allowing the user to easily search for photos with n or more stars.

The flag status, unfortunately, is not available to the plugin, so I can’t add that. I’ve just pushed new versions with an enhanced Rating token that allows for what you want. —Jeffrey

— comment by David on September 20th, 2008 at 2:22am JST (5 years, 11 months ago) comment permalink

Whenever I attempt to upload photos to Flickr, it never shows the Album names. As I cant choose an album, the upload always fails. In uploads to Zenfolio, it always shows them, and uploads are successful.

— comment by Bob Johnston on October 4th, 2008 at 5:32am JST (5 years, 11 months ago) comment permalink

The DD token returns the day that the photo was pulled off the camera, not the actual day that the photo was taken. I confirmed this via the metadata information for the image.

— comment by cas on October 4th, 2008 at 7:34am JST (5 years, 11 months ago) comment permalink

Excellent plugin. The option to create sets dynamically based on folder name, exif data, etc and the ability to create tags from exif data are two things I’ve been searching for. As far as I know, you are the only person to have implemented such a feature, and I think you for adding it.

A couple small requests if you have time..
- At the moment YYYY MM DD SS are all possible, but no hours and minutes. Can this be added, along with JobCode?
- Fantastic to have ISO. For Aperture you currently have Aperture and ApertureNum. Could you do the same for ISO? Ie, so ISO would return ISO320, and ISONum would return just 320? I tried doing ISO{ISO} but in the case {ISO} is not available I am just left with the string ISO
- Fractions in ShutterSpeed do not display properly in flickr (at least for me), and ShutterSpeedNum has very long fractions in some cases – like 0.834289347289347. Could you perhaps add ShutterSpeedNum4 which would truncate to 4dp? or something similar
- Last but not least, Path seems to return a full path, etc “> Users > ABC > Dir1 > Dir2 ….” I tried to use the After option to remove the “> Users > ABC > ” part but it complains “Hierarchical structions not allowed with this plugin”. Can this be fixed?
- Finally, like many others I am trying to work out how to get a newline to appear in the flickr description. I tried the html for br, and backslash n, but to no joy.

Once again, thank you very much for your hard work on this plugin.

— comment by Alan on October 6th, 2008 at 2:32pm JST (5 years, 11 months ago) comment permalink

Are conditionals something that might be possible in a future version? For captioning on Flickr, I use the format Location | City, State in the Description field.

With this wonderfully, marvelous plugin, I can automate this by {Location} | {City}, {State} but the Location is somewhat optional for me so if the Location field isn’t filled out I get “| City, State” — note the meaningless pipe.

If I could do something like, oh, {if Location}{Location} |{/if}{City}, {State} that would be wonderful.

Thanks, so much, for this plugin.

— comment by Brooks on October 7th, 2008 at 11:48am JST (5 years, 11 months ago) comment permalink

Thank you very much. Fantastic plug-in. It would be awesome to have LR Collections. Is it anyway possible? Once again thank you!

— comment by Stepan Spinka on October 26th, 2008 at 7:03am JST (5 years, 10 months ago) comment permalink

Hi, love you plugins. Yet I miss one feature: parsing exif strings, since I don’t mind getting my hand dirty. For example, if you choose {CameraModel} I get NIKON D700. It would be nifty to just get D700.

While I’m at it, might is suggest a lowercase uppercase converter? You know, Nikon D700 instead of NIKON D700. If you ever make one, be sure to leave an option whether or not to leave the first letter of a word capital (eg. Canon Powershot 520).

Keep up the good work!

— comment by krome on November 6th, 2008 at 5:24am JST (5 years, 10 months ago) comment permalink

Hi Jeffrey, and thanx for the great tool. I have yet to upload my first pics to flickr though, because i’m still trying to figure out the newline thing. I’ve read all the posts, and like others I can’t get it to work.

Seems like we have to insert a somewhere, but where ? I tried differents things like
{CameraModel} {Lens}
{CameraModel } {Lens}
{CameraModel} “” {Lens}
… but none of those worked.

In one of your replies you’re mentionning an option to check, to interpret text as html, but I don’t know where to find that option. Is it on our flickr settings page ? In your plugin ?

Finally, if we manage to get it to work, will the preview display newlines (I tried exporting some pictures to double check that it wasn’t just a preview issue but same result) ?

Can somebody who know how to do this post a sample code ? And explain about the “interpret text as html” option ?

Thanx.

— comment by sebchang on November 12th, 2008 at 4:12am JST (5 years, 10 months ago) comment permalink

All:

For those seeking to add breaks (carriage returns, line feeds, etc) into your template comment text: I’ve had success on Windoze (flickr upload plugin) by creating a separate document with the instructions in it (including newlines) then pasting the entire thing into the template field. Adding or tags did not work, and the enter key gets trapped by the plugin to exit the field editing. So pasting is working well for me.

Nathan Siemers

— comment by Nathan Siemers on December 10th, 2008 at 12:38am JST (5 years, 9 months ago) comment permalink

Oops – some html got stripped above, it should be:

“Adding paragraph or break html tags did not work…”

N

— comment by Nathan Siemers on December 10th, 2008 at 12:39am JST (5 years, 9 months ago) comment permalink

Doh! I just upgraded to .60 from .57 and this trick no longer seems to work. Sigh.

— comment by Nathan Siemers on December 10th, 2008 at 2:06am JST (5 years, 9 months ago) comment permalink

Thanx for the tip Nathan, but I think I tried that and it didn’t work, even before I upgraded the plugin, but maybe it has to do with the fact that I’m running OSX.
Still nobody with some kind of clue to help us insert line breaks ?? Please !!

— comment by sebchang on December 12th, 2008 at 6:36am JST (5 years, 9 months ago) comment permalink

What little I messed around with it, it appears that Lightroom is the culprit and doesn’t like blank space or “empty” hard returns in it’s fields. What I’ve found works is to build the caption text in Notepad (Windows, sorry, no clue about Macs) and for every blank line make sure there’s a character of some sort at the beginning of the line like a period or a dash (ignore the quotes):

“This would be the caption text
.
.”

The template I then use is:
{Caption} {All my EXIF info}

When the above is uploaded, the caption section below the photo looks like this on flickr:

“This would be the caption text
.
.Canon 30D, EF800mm f/5.6L IS USM, f/5.6, 1/1000, ISO200″

Notice the second period to have a gap between lines, because Lightroom will ignore the hard return after the first period. I’ve just tried this with .60 successfuly.

(And no, I don’t have the 800mm lens, but I can dream…)

— comment by JasonP on December 12th, 2008 at 3:31pm JST (5 years, 9 months ago) comment permalink

Is there a way to get the “original number suffix” field?

— comment by Fabrizio on December 25th, 2008 at 2:47am JST (5 years, 8 months ago) comment permalink

I try everything but can’t create the page breaks, is there a solution?

— comment by luigi the photografer on January 21st, 2009 at 8:42am JST (5 years, 7 months ago) comment permalink

As post above using version 63 to get page brakes do the following (windows only)

open up notepad type in info you want on each line when you need a carriage return hold down the alt key and type 013 on numeric keypad you should see a new line created once done copy back to lightroom and past should text on each line. Tested and used works fine

Heart_and_soul

— comment by Adrian on January 21st, 2009 at 9:03am JST (5 years, 7 months ago) comment permalink

is there any way to get custom name {Custom Text}, this what lightroom calls it but it’s just I give each file a name in light room but when I use Description Preset it seems to not save the title.

Heart_and_soul

I don’t believe there is, no, sorry. —Jeffrey

— comment by Adrian on January 21st, 2009 at 9:48am JST (5 years, 7 months ago) comment permalink

Thanks Adrian but i use Leopard.

The button “Token Examples” also didn’t work, I don’t know if that’s also a issue related to Leopard.

— comment by luigi the photografer on January 21st, 2009 at 8:46pm JST (5 years, 7 months ago) comment permalink

Hi Jeffrey,

Thanks for creating this great tool! The ‘export to SmugMug’ plug-in is extremely useful, and has saved me a ton of time and work. I just have one question: have you thought of creating an export filter with the preset templates functionality? I would love to be able to export to disk or with any export plugin, and havethe ability to do things such as adding the location fields to the keywords.

Thanks.

— comment by FernandoK on February 7th, 2009 at 10:07am JST (5 years, 7 months ago) comment permalink

Hi Jeffrey,
I just changed computer and would like to know where those settings are saved.
Thanks

Your Lightroom Preferences file. —Jeffrey

— comment by Marc on March 7th, 2009 at 10:37am JST (5 years, 6 months ago) comment permalink

Hi Jeffrey,

I’m using the Flickr plugin for some time now and like it a lot so I registered yesterday and upgraded to the latest version. It makes live so much easier. Thanks for that!

Over time I’m spending more and more time on getting the metadata tags right. Since I don’t have the time to dive into the SDK and define my own tags, I stick to what is available. So as a caption I often have the English, Latin and Dutch names for a particular animal. Like this: Meerkat – Suricata suricatta – Stokstaartje.
In Flickr I then add these seperately as tags. If you need an example: http://www.flickr.com/photos/edsteenhoek/2546275842/

So I was wondering if it is possible to add splitting as part of the preset templates? Something like this: {caption:split=”-”}.

Thanks,
Ed

Yeah, that should be easy enough to add… great idea. Look for it in a new version, soon. —Jeffrey

— comment by Ed Steenhoek on March 8th, 2009 at 9:58pm JST (5 years, 6 months ago) comment permalink

Jasonn here from Trinidad…

I accidentally updated the NONE preset – and now I cant get it to be well… none lol
If I delete the fields, it disables the update button…so i’m using caption to fake it for the moment.

Just a thought, just like you cant delete the none preset, you should not be able to edit/update it as well…

Thanks,
J

I didn’t think it was possible to delete the ‘none’ preset. I’ll look into it. —Jeffrey

— comment by Jasonn on April 11th, 2009 at 9:03pm JST (5 years, 5 months ago) comment permalink

Hey Jeffrey,

No, as it is right now, you *cannot* delete the NONE preset, but you *can* edit it.

The problem is, once you edit it, accidentally or otherwise, there no way to clear the fields to restore it to the original NONE preset.

Thus I was suggesting you make sure that you cannot *edit* as well as *delete* the NONE Preset.

Sorry for the mixup.

-J

— comment by Jasonn on April 11th, 2009 at 9:32pm JST (5 years, 5 months ago) comment permalink

Hi there, is it possible to recieve UserComment or other string so I can automatically pass some Tags via Token?

Thanks
luigi

I’m not sure what you mean, either about what you want or where you want to use it. Could you drop me an email with more info? —Jeffrey

— comment by luigi on June 15th, 2009 at 5:30am JST (5 years, 2 months ago) comment permalink

I really like the joining characters feature, but it isn’t working well for me. It seems to work only when the elements are joined by exactly one of the special characters, and only when all are the same character. I’d like to be able to separate some elements by the comma-space sequence and others by a space. I’d also like to be able to use the line break marker within the pattern.

I just pushed v116 that may work a bit better. Give it a try and let me know…. —Jeffrey

— comment by Peter Epstein on June 30th, 2009 at 3:24pm JST (5 years, 2 months ago) comment permalink

Yes indeed, the new version works perfectly. Now that’s awesome support!

— comment by Peter Epstein on July 4th, 2009 at 3:49am JST (5 years, 2 months ago) comment permalink

Hi Jeffrey,

I have two requests

1/ In some cases I need to do two line breaks. If I try the second is obviously squelched and {} doesn’t work.

2/ The token {CameraModel} gives me NIKON D200. How to get this result => Nikon D200 ?

Would it be possible to combine two token filters? LC and UCFirst

Thanks
Florent

— comment by Florent Bouckenooghe on July 23rd, 2009 at 4:23am JST (5 years, 1 month ago) comment permalink

I’ve been using your flickr plugin for some time, and today I’ve discovered this feature. I think it is great! Like all your plugins!

I would like to ask if it could be possible to add a link to Google maps using GPS position. Is it possible right, now? If not, could it be possible that you add this feature in a new release?

Thanks!

You can build up the link in a caption using the token templates that I’ve built into the plugin…. something along the lines of <a href=’http://maps.google.com/?q={Latitude},{Longitude}’>click for map</a> —Jeffrey

— comment by Otger on August 21st, 2009 at 9:46pm JST (5 years ago) comment permalink

Maybe I’m just stupid, but is there a way with this to use Lightroom keywords to put photos in a particular Flickr set (and even better, into a certain set if a particular combination of keywords exists?)

Thanks,
Krys from Denver, CO

No, that’s not there yet, but it’s a good idea… added to the todo list. —Jeffrey

— comment by Krys on September 11th, 2009 at 7:21am JST (5 years ago) comment permalink

I’m using LR3b and I’ve a question regarding the auto-destination. Is it possible to use the name of the collection (as set in the Publish Service) for the PicasaWeb album name?

I think this will be quite handy.

Thanks.

Don’t know yet. Will certainly look for that when I get docs. —Jeffrey

— comment by Pascal Obry on October 23rd, 2009 at 8:53pm JST (4 years, 10 months ago) comment permalink

from Santa Barbara, CA
I don’t have a question; I just wanted to say thanks for all your hard work. I’m FINALLY getting around to learning the various plugins’ capabilities and am amazed at what they can do. You do spectacular work.

— comment by Stuart Ponder on November 15th, 2009 at 7:11pm JST (4 years, 9 months ago) comment permalink

Great work and thanks for all of the plugins you offer that make our workflow as photographers better. cheers

— comment by Max Finger on November 16th, 2009 at 9:51pm JST (4 years, 9 months ago) comment permalink

Hi Jeffrey,

Another request: it would be great if we have a token that helps us name the flickr/facebook folder based on either the photoset or smart photoset’s name? Thanks much!

-Dev

— comment by Devender Narang on December 14th, 2009 at 1:20pm JST (4 years, 8 months ago) comment permalink

The matter of line breaks in the Caption Preset has been mentioned before but not being a programmer, I don’t quite understand the answer. I’m not sure if you were saying that it might not be possible for some programs. I want to have “Title” line break “Caption”. I have tried “{Title}{Caption}” in both plain and HTML but that didn’t do it. I’m exporting to SmugMug.

Add <br> where you want the line break, e.g. “{Title}<br>{Caption}”, and the line break will be inserted when you have both a Title and a Caption. —Jeffrey

— comment by Bob on December 23rd, 2009 at 3:46pm JST (4 years, 8 months ago) comment permalink

FOr some reason, I cannot get the Token for the “Date Created” to work.

If I use: “2010.{Date}”, it always comes out as “2010.31″ and the “31″ suffix makes no sense to me given the template instrucitons.

If I try “2010.{date}”, it comes out with “2010.10″ which is correct since today is January 10th. However, this doesn’t help me because the photo was taken on January 9th, which is why I’m trying to use “2010.{Date}”.

Is this just a bug or am I misunderstanding how this is supposed to work?

No misunderstanding…. it’s supposed to be how you describe you expect it. Could you check the ‘All’ metadata-viewer preset to see whether any of the dates have 31 for the day-of-month value? If not, try typing {Date} into the “extra keywords” box, see the example value is wrong, then visit the plugin manager and use the “send to Jeffrey” button to send me the log, and I’ll check it out. —Jeffrey

— comment by TC on January 10th, 2010 at 5:10pm JST (4 years, 8 months ago) comment permalink

Jeffrey:

I figured out the mystery (sort of) and it’s not a bug with your plugin. It looks as though any of the iPhone apps that post-process photos aren’t setting the date correctly in the EXIF tags. The native iPhone camera app DOES do it correctly though.

Oddly, when I go into Lightroom and “Edit Capture Time” on one of the offending photos, it has the correct date and time that the photo was taken — it’s just not appearing in the “All Metadata” view. I think it’s because Lightroom is looking at the “File Creation” date when the EXIF Date is missing.

So I’m suspecting either there’s a bug in the iPhone overall that doesn’t let the apps write the EXIF data correctly, or all these 3rd party apps are just lazy and not carrying over the EXIF data.

— comment by TC on January 11th, 2010 at 4:33am JST (4 years, 8 months ago) comment permalink

Hi Jeffrey,
I’m having issues with the “OnlineID” token. Instead of “View on Black” It’s simply showing off as text. And when I click on the description at Flickr, I see that a few extra characters have been added — seems flickr is converting the “<" into"&l".

"<a href="http://bighugelabs.com/onblack.php?id=4285385251&size=large">View on Black</a>"

Thanks for your help in advance.
-Dev

Are you sure you have the html/text selector set to html? —Jeffrey

— comment by Devender Narang on January 19th, 2010 at 6:46am JST (4 years, 7 months ago) comment permalink

Sorry, very new at this.. How do I create the upload destination so that each folder I create in the PiCASAWEB published service appears? Currently I create each destination separately in the publishing manager? Thanks!

Publish is not really working in the Lr3 beta… best to wait for the real Lr3 to come out, using the normal export until then. —Jeffrey

— comment by John on April 27th, 2010 at 7:40pm JST (4 years, 4 months ago) comment permalink

I am not sure how to use the templates to automatically put the photos into particular(existing) flickr sets based on keywords.

Templates have nothing to do with sets… there’s a keyword/set mapper in the destination section of the dialog. —Jeffrey

— comment by Yash on May 9th, 2010 at 1:50am JST (4 years, 4 months ago) comment permalink

Gallery Destination Question:
On Zenfolio, I have a group called “Recital 2008 Saturday” which contains galleries of the structure “D 8 The Potter waltz” and “D 9 Steam heat” and so on. I have put the gallery names into the metadata filed Caption in Lightroom.
So, my hope was that I can upload using an Automatic-Destination Preset, like this one:
“Recital 2008, Saturday >”{Caption}
but it tells me: “?:14813: table index is nil”
I also tried:
Recital 2008, Saturday > {Caption}
“Recital 2008, Saturday” > {Caption}
which always results in the same error.
Can you give me the correct string? Also, will the use of the template create galleries if they do not exist yet?
Thanks a ton!
CU
Heiko

What you are trying to do should work… I’ll take a look at it, but unfortunately even if I fix it locally, I’ll not be able to push out a new version for a couple of weeks. I’ll let you know how it goes… —Jeffrey

— comment by Heiko on May 26th, 2010 at 6:47pm JST (4 years, 3 months ago) comment permalink

There is the token {Keywords} that returns all keywords marked for export. I have the problem that somehow a scattering of keywords in lightroom have been created or changed such that they are checked as do not export. Given the 1000′s of keywords, I’m not feeling up to going through and manually checking every single keyword.

Would it be possible to have a token {KeywordsAll} or some such thing that would return every keyword the photo is marked with. With this, I would place that token in the “Extra tags to register with image” and thus all my keywords would export (since I don’t have any keywords that I don’t export). I realize the best solution would be for me to go through and edit each keyword … slightly daunting. A nice solution would be if there was a utility for mass selection of all Lightroom keywords for organization, management and changing those kind of details.

I can add {KeywordsAll} easily enough, so it’ll be in the next versions of each plugin as it goes out, but it won’t help your situation because the whole list would be treated as one keyword (the result of the tokens are not subjected to another round of parsing). Tim Armes has a plugin called Keyword Master, so I’ve suggested to him that it offer some way to help in this situation…. —Jeffrey

— comment by Carl M Christensen on July 25th, 2010 at 8:15am JST (4 years, 1 month ago) comment permalink

Keyword filter question:

I have many keywords grouped into sets that don’t export, for example individual animal names, that are also assigned with “wildlife”.

Is there a way to filter and use just those keywords that are contained within the set “wildlife” as the caption for an image?

Thanks

Not that I can think of, sorry. —Jeffrey

— comment by James on August 30th, 2010 at 6:08pm JST (4 years ago) comment permalink

More great work Jeff!

As others have asked in the above comments, any update on accessing Collection info in LR 3.2 (whether it be in your presets, text exports, etc.)?

For photo gallery websites that use databases (eg, Joomla, Drupal, etc.), it would be INCREDIBLY useful to be able to export text (csv, xml, whathave you) lists of the desired apps that would include collection(s) hierarchies, image name, path to thumbnail and full image, meta data, etc.

— comment by Chris Ogden on September 17th, 2010 at 11:52pm JST (3 years, 11 months ago) comment permalink

still wondering what values the OriginalWidth and OriginalHeight tokens return ? is it the original size of the picture or the cropped size ? i am talking about the cropped size after using the resize tool in lightroom not the cropped size that we give on export ?

Yes, that is ambiguous, isn’t it. They’re for the original (possibly pre-crop) of the master image on disk. I’ve pushed new versions that also include CroppedWidth and CroppedHeight to reference the post-crop size of the image in the library. —Jeffrey

— comment by frank on January 13th, 2011 at 10:49am JST (3 years, 8 months ago) comment permalink

Wow using LUA for conditional text was uncommonly easy. Thank you very much.

— comment by Clay on April 14th, 2011 at 5:52am JST (3 years, 4 months ago) comment permalink

Thanks for the great plug-in. I’m hoping to use Lightroom + Zenfolio for a huge graduation portrait project at our college in Gainesville Florida, Friday April 29, 2011. The question I have is how to Publish each client image so that they are in their own client gallery? I’m using the Caption -FileNumber as a unique identifier and I would like that to also be the client access code. My students will be processing 300-600 portrait sessions with 3-5 images each. I’m trying to setup the publish process as simple and fast as possible. Any thoughts?

Thanks,

Wes

You can use the auto-destination feature to create galleries on the fly based upon metadata, and particularly using the LUA templat you can construct arbitrarily-complex ways of converting the metadata into a gallery name. But if you want more than one image in the same gallery, you’ll need to ensure that those images all share some bit of metadata (e.g. a caption with the subject’s name). There’s nothing in the plugin that will handle setting an access code for the gallery, so that’ll have to be handled separately. But since you can have the plugin open the gallery in the browser after the upload completes, it’s hopefully not too difficult to just use that page to set the access code. —Jeffrey

— comment by Wes Lindberg on April 28th, 2011 at 12:12pm JST (3 years, 4 months ago) comment permalink

I’ve been looking for a way to include a series/sequence number in the template the same way that the file renaming allows for (1 of 12) as part of the file name. Am I missing something really obvious?

No, you’re not missing anything… it’s not there. It’s not necessarily as straightforward as some of the other items, but I’ll give it some thought. —Jeffrey

— comment by Colin Johnson on August 8th, 2011 at 12:02am JST (3 years ago) comment permalink

Hello Jeffrey,

any way to use PhotoDate with a function like “add 1 month”? When we publish to PicasaWeb, we’d like to name the album including a “online until” – date which is 1 months after pictures are created (pictures should be removed after one month) and the visitors should be informed by an appendix in the name of the album.

Of course a template like {Folder}_Album_online_until_{YYYY}/{MM+1}/{DD} is not working. Any way to do this?

Regards from Germany,

Well, it’s a bit kludgy, but you can use the LUA template, along the lines of

{LUA=mm=="12" and sprintf("%04d", tonumber(yyyy)+1) or yyyy}

for the year,

{LUA=mm=="12" and sprintf("%02d", tonumber(mm)+1) or mm}

for the month, and

{LUA=tonumber(dd) < 28 and dd or 28}

for the day.

That all makes it one month from the current date… replace each yyyy, mm, and dd with their upper-case equivalents for the photo date). —Jeffrey

— comment by Lucas Hummig on October 24th, 2011 at 8:25pm JST (2 years, 10 months ago) comment permalink

First, thanks for the wonderful work on this and your other plugins. I’ve found the ability to custom build captions (especially for flickr) to be very valuable. I shoot both digital and film and since I’m pretty anal about keeping my information in EXIF I’m wondering the following:

I know you use Phil Harvey’s EXIF tool for various things in your plugins. Is it possible to build a token that would allow the user to input the field to be read out of EXIF for use in the caption and/or title?

I’m thinking something like {EXIFtool:xmp.film} that would result in “Velvia 50″ or whatever happens to be in that field for that image.

In short, I’m looking for a way to exposure more EXIF data than what lightroom recognizes… inside your title/caption presents.

Thanks,

John

That’s a good idea, except that it then requires that I bundle a full ExifTool executable with each plugin, and fire off a separate process for each caption. Those are not brick walls, but at this point enough of a weight to keep it from bubbling up on my todo list… —Jeffrey

— comment by John on December 5th, 2011 at 11:26am JST (2 years, 9 months ago) comment permalink

Hi,
When using the plugin to make a “full backup” of all images in 640×480 pixel, I end up getting filenames with a “-2″ or “-3″ at the end of some – not all – images.

Why is that?
Using Lr 3

Because, I’d guess, your file-naming rule results in the same name for multiple images. This might happen, for example, if you have virtual copies of an image, but you don’t use a file-naming template that accounts for the copy name. —Jeffrey

— comment by Chris on February 18th, 2012 at 3:07am JST (2 years, 6 months ago) comment permalink

Update to the comment on “February 18th, 2012 at 3:07am JST”.

Hi Jeffrey,
I’ve tried to have only 4 NEF images located in one folder. The file names are 0001.NEF, 0002.NEF, 0003.NEF and 0004.NEF.

When running the plug-in, they would be outputted in the correct folder, but with these file names
0001.jpg, 0002.jpg, 0003-3.jpg and 0004-3.jpg.

There are no other files in this folder and my settings are following:
Export as JPG and resize to 640×480 at 72 PPI. No re-naming has been set.

All the best,
Chris

This is all controlled directly by Lightroom so I can only guess, but I’d guess that they never want to name a JPG with the same basename as a raw file, because Lightroom normally treats that as a coupled pair, and considers the JPG a sidecar of the raw file. Since that’s clearly not the case when you’re creating the JPGs out of camera, they change the target filename to avoid the conflict. —Jeffrey

— comment by Chris on February 21st, 2012 at 1:09am JST (2 years, 6 months ago) comment permalink

He Jeffrey, has there been any progress about that issue?

“It is possible for picasa plugin to use LR4 reverse geocoding suggestions whenever address fields are empty when using tokens like {City}, {Country} etc.? Now those suggestions are invisible. Or maybe create tokens like: {CitySuggestion}.”

No, this is not the speed that Adobe works on. At best I’d think it might show up in Lr5, but practically speaking it may well be something they never address. —Jeffrey

— comment by JoshX on May 7th, 2012 at 5:23pm JST (2 years, 4 months ago) comment permalink

Does the plugin dont heave any acces to those suggestions (to create token like {CitySuggestion})?

Yes, that is correct. A plugin can’t know whether there are suggestions, or what they might be. I hope Adobe will grant this access in the future, but for now it’s not possible. —Jeffrey

— comment by JoshX on May 12th, 2012 at 7:01pm JST (2 years, 4 months ago) comment permalink

Hello,
I want to know if there are possible to convert the following parameters
OriginalWidth and OriginalHeight in cm? to position in the file name
example: {LibraryFilename OriginalWidth} x OriginalHeight pixels
{LibraryFilename} 5907 x 8865 pixels

to

{LibraryFilename} 100.0 cm x 150.1 cm

thank you

Yes, it should be possible with the {LUA} token, assuming you know what resolution you want to convert with. Using your example of 59.07 pixels/cm, you’d want the token:
     {LUA=sprintf("%s %.1f cm x %.1f cm", FILENAME, OriginalWidth/59.07, OriginalHeight/59.07)}
—Jeffrey

— comment by Pierre C on May 19th, 2012 at 6:57pm JST (2 years, 3 months ago) comment permalink

I would like to see a few more tokens available. When I upload photos to FB, for example, I love being able to use the {SmugMugUrl} token to point directly to the photo URL of a photo already uploaded to SM. I’d like to see added something like a {SmugMugAlbumUrl} that will point to the whole album. This is nice to help people know there might be more available and how to find them in one click.

I really like the {IfGeocoded=xxxx}. I’ve written my token to auto add the GPS coordinates and a Google Maps link if the coordinates are in the meta data. I would like to see a few more {Ifxxxxx} tokens available, such as {IfSmugMugUrl=xxx}. Right now I have to have a few different caption tokens set up, one if I have uploaded something to SM, another if I haven’t. Having the {IfSmugMugUrl=xxxxx} would add some simplicity. Those two would really save me some time.

For anyone curious, here is the token code for GPS corrdinate posting when I post on FB or SM;

{IfGeoencoded=Photo geoencoded at:} {GPSCoordinates}  {" "}   {IfGeoencoded=[} {" "} {IfGeoencoded=http://maps.google.com/?q=}{Latitude}{IfGeoencoded=,}{Longitude} {" "} {IfGeoencoded=]}

This is getting complex enough that I’d ask you to dip into the {LUA=...} tag. Recent versions of the plugins allow you to keep your Lua code in a local file, and merely refer to it from the tokens, so you can make your captions as arbitrarily complex as you’d like without having to try to type it into the little caption fields. —Jeffrey

— comment by michael b on July 31st, 2012 at 10:06am JST (2 years ago) comment permalink

How do I call a function from a external lua file, loaded via load() ?
I tried it this way:
{LUA=return load(“/Users/Linus/Documents/lightroom_naming_helper.lua”)}-{LUA=wochentag(DD)}

and

lightroom_naming_helper.lua:
function wochentag (d)
days={‘sonntag’,”montag”,”dienstag”,”mittwoch”,”donnerstag”,”freitag”,”samstag”}
return days[d]
end

return “”

but I get a runtime error: “hey” unknown.

How do I get the localized weekday of the photo date?
I tried
{LUA:LC=os.date(“%A”, DD))}
but it returns the english name.
I also tried something with os.setlocale, but setlocale gives me an error (nil value).
{LUA:LC=sprintf(os.setlocale(‘de_DE’) or os.date(“%A”, DD))}

I would like to combine filters. My current workaround is
{LUA:S2D=string.lower(Folder)}

For the sequence number I use {Filename} and let Lightroom name the file with the tree digit sequence number. It would be easier if there is a sequence number function.

Lightroom doesn’t make os.setlocale available to plugins. I’ve updated the docs on this page to better reflect just what’s in the special LUA environment.

The load() lasts only as long as the LUA that it’s in, so you want to simply use {LUA=load(path)} and put the following in your helper file:

weekDays = {"sonntag","montag","dienstag","mittwoch","donnerstag","freitag","samstag"}
function wochentag()
   if photoTime then
      local timeComponents = { LrDate.timestampToComponents(photoTime) }
      local dayOfWeek = timeComponents[7]
      return weekDays[dayOfWeek]
   end
end

return wochentag()

However, you could also return "" in the lua file, then use {LUA=load(path) return wochentag()} as the LUA tag. This approach allows you to put various routines you might want into one lua file, then call on each as appropriate for the specific LUA tag, allowing you to avoid a bunch of little lua files.

NOTE: take care if you cut-n-paste code from comments on my blog; the blog system dorks the single and double quotes within comments.

By the way, your approach with DD suffers two problems: it’s a string, and it’s the day of the month.

Also by he way, the photoTime variable is new… I just added it to version .197 of the PicasaWeb plugin… other plugins will follow soon… look for version dates Aug 20, 2012 or later.

Sequence numbers will be problematic… I’ll have to dig a bit. —Jeffrey

— comment by Wolfgang on August 20th, 2012 at 9:44pm JST (2 years ago) comment permalink

To get the filename number suffix:
{LUA=string.gsub(Filename, “.+_”, “”)}

With leading zeroes stripped:
{LUA=string.gsub(Filename, “.+_0*”, “”)}

— comment by Josh on October 11th, 2012 at 10:20am JST (1 year, 11 months ago) comment permalink

To have a line break, simply select (the invisible one, unless you have show formatting turned on) & copy one from the end of a paragraph line (before next paragraph) from a word processing app & paste directly where you want it into your picture info’s custom text. Hope this helps! I just tried it & it worked for me (no plugin was required) in Lightroom 4. Your site got me going in the right direction, but then I though I’d just try an old trick.

— comment by Sam on October 19th, 2012 at 12:54pm JST (1 year, 10 months ago) comment permalink

Great plugin! (well, you got a bunch of great ones indeed…)

I tried to used the {Software} token, but found no place where I could manualy or automatically enter it.

Software is defined as “The photo’s “Software” metadata item in Lightroom’s database.” but how is it defined?

Serge

It’s often added by other software (before loading into Lightroom), e.g. Photoshop. If you work primarily with Lightroom straight from the camera, {Software} will be blank. —Jeffrey

— comment by Serge on December 8th, 2012 at 1:17pm JST (1 year, 9 months ago) comment permalink

Hi.

I have some photos (typically edited on my iPhone) that seems to be without correct EXIF data. Lightroom shows the correct capture date/time (but this could be the file timestamp) and is also able to use this date/time in smart collections, but your plugins fails when it tries to extract YYYY. Are you able to use the same logic as Lightroom does to ensure that photos that matches my smart collection criteria using date/time is also correctly handled by your plugins?

Thanks!

A photo’s date can appear in Lightroom in many ways… in the Loupe info overlay, in the metadata panel, via the plugin SDK, in how the date is sorted during import, etc. As far as I can tell, unless the photos were taken in the same timezone as your computer is now, the dates all differ among themselves. It’s maddening. I’ve made repeated bug reports to Adobe… nothing else we can do. )-: —Jeffrey

— comment by Henrik on February 11th, 2013 at 9:44pm JST (1 year, 7 months ago) comment permalink

Great tools, I have used a number of them since LR2.
Need the negative logic of your {YYYY|yyyy} feature. So if the first item has content it is replaced by second item. So I could do things like {Lens||”Lens=” Lens} to get output of “Lens= 28mm f2.8″ but nothing if it is empty. (using “||” to indicate function, could be whatever).
Also in my batch file I use sed and imagemagik to put a large multi-line text box on bottom of image. So I have this “{Title}\n{Caption}\n{D1} {T1}” passed as one parameter to .bat file. Then sed converts \n to real newlines and pipes it to imagemagik’s convert with the caption option which creates right size box at bottom of image, wordwraps Title and Caption if they are long and starts Caption and date on a newline. So in my case want to avoid putting out “\n” if field is empty.

For these you’d want to use the {LUA=…} token. The doc’s “CreatorPhone” example is exactly what you’re looking for. —Jeffrey

— comment by Cliff Hall on October 16th, 2013 at 12:26pm JST (10 months, 12 days ago) comment permalink

You saved my neck with the image preview -retrieve plug in. 1000 thanks and blessings to you.

— comment by Anonymous on November 10th, 2013 at 4:23pm JST (9 months, 18 days ago) comment permalink

OK, first off writing from Afghanistan.

First off thanks for the plug-ins, very helpful. I was wondering if there is a way via tokens to add the “Published Collection” name? It would be helpful for when something goes wrong and I need to put things back. Also as a tag.

Thanks

Scott

I just added a {PublishCollectionName} token to the Collection Publisher and Folder Publisher plugins. It’ll eventually make it to the other plugins… if you let me know which you need, I can do that one first… —Jeffrey

— comment by Scott on December 12th, 2013 at 7:35pm JST (8 months, 16 days ago) comment permalink

Hi Guys, Jeffrey,
Thanks for great job. I’m struggling to extract a folder name from a full path.

With {FolderPath}, I can get :

Volumes/PhotoDabase/NameofAlbum/Datefolder/filename.jpg

With {FolderPath:After=PhotoDatabase/}, I can get :

NameofAlbum/datfolder/filename.jpg

What I only want to get is :

NameofAlbum

How could I do it? I’m searching for a kind of {caption:before=/} token but I can’t find out.

Could somebody provide me some support please?

Thanks in advance, regards

Fabrice

This should do it for you: {LUA=FolderPath:match(“/([^/]+)/[^/]+$”)} —Jeffrey

— comment by FabriceRO on April 12th, 2014 at 6:23pm JST (4 months, 16 days ago) comment permalink

Hi Jeffrey, thank you for your super-awesome plug-ins!
I have a question though, couldn’t find anything suitable: is there a way to use templates to assign dynamic keywords with the tokens without invoking “export” stuff?
Thanks!

No, sorry, none of my plugins do that. —Jeffrey

— comment by Vitaliy on June 6th, 2014 at 7:54pm JST (2 months, 22 days ago) comment permalink

Hello. I hope someone can help me cause I beat against the wall but still can’t understand how to do what I want to do.
I want to insert the age of the child in Years, Months and Days, but can’t really understand how to do this with LUA… Thank you!

Calculating a time difference like that is more difficult than one might think, but yeah, I’ve wanted the same kind of thing myself, so your comment prompted me to add it. After upgrading the plugin, see the date_diff() function in the LUA template token docs. —Jeffrey

— comment by Vitaliy on June 13th, 2014 at 1:32am JST (2 months, 16 days ago) comment permalink

Would it be possible to add the UserComment token to the supported ones?

UserComment is an EXIF metadata item which is set by the Canon WFT “Caption” (sic!) feature. One can select between one of 15 preset captions which are then included while the image is uploaded to a (FTP) server. One could use UserComment to steer i.e. the destination album for a publish service.

Kind regards
Roland

Unfortunately, that’s not one of the fields that Adobe exposes to plugins. FWIW I’ve submitted a feature request for it, but I’ve long asked for all fields to be exposed, so perhaps they have reasons for the ones they’ve chosen. —Jeffrey

— comment by Roland Reiss on June 16th, 2014 at 7:41pm JST (2 months, 12 days ago) comment permalink

1. I would like to suggest a “replace slash with space” (or underscore).
2. Is there a way to combine/stack filters, processing the result of one with another?

I had an idea (for the Collection Publisher) where I would like to shorten the FolderPath down to the actual Lightroom structure names – and thn convert it to one string by replacing dashes to spaces (or underscore) “/some/base/directory/MyPhotos/2014/june/birthday” -> 2014_june_birthday”

I would like to be able to do something like this: {FolderPath:After=MyPhotos/:SL2S}

Your best bet is to use the {LUA} token, off the top of my head, {LUA=FolderPath:gsub(‘.*MyPhotos/’,”):gsub(‘/’, ‘_’)}

— comment by Christer L on June 22nd, 2014 at 11:57pm JST (2 months, 6 days ago) comment permalink
Leave a comment...


All comments are invisible to others until Jeffrey approves them.

Please mention what part of the world you're writing from, if you don't mind. It's always interesting to see where people are visiting from.

More or less plain text — see below for allowed markup

You can use the following tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting