Preset Template Tokens in My Lightroom Plugins

Many of my plugins for Adobe Lightroom Classic 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
SST1 The sub-second value for the time the photo was taken, as a single-digit number of tenths of a second. If the photo time was not captured to detail beyond integral seconds, the value is 0.
SST2 The sub-second value for the time the photo was taken, as a two-digit number of hundredths of a second. If the photo time is not available to detail beyond integral seconds, the value is 00.
SST3 The sub-second value for the time the photo was taken, as a three-digit number of thousandths of a second. If the photo time is not available to detail beyond integral seconds, the value is 000.
Weekday Localized day of the week that the photo was taken (e.g. Wednesday).
Wday Localized short form (usually three-character string) of the day of the week that the photo was taken (e.g. Wed).
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
DAYNUM The ISO-8601 day of the year that the photo was taken on, as a three-digit string.
WEEKNUM The ISO-8601 week of the year that the photo was taken on, as a two-digit string.
ISO8601Date The ISO 8601 date/time string of the photo. Unlike other date-related fields, this may include a timezone indication, and/or a sub-second timestamp.
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.
IptcDateCreated The IPTC Date Created field.
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
weekday The current day of the week, as a localized string, e.g. Wednesday.
wday The current day of the week, as short-form (usually three-character) localized string, e.g. Wed.
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
daynum The current ISO-8601 day of the year, as a three-digit string.
weeknum The current ISO-8601 week of the year, as a 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.
Master File Filesystem Dates
These are available only if the master image file is currently available.
FileYYYY File creation year, as a four-digit string
FileYY File creation year, as a two-digit string
FileMM File creation month, as a two-digit string
FileDD File creation day of the month, as a two-digit string
FileHH File creation hour value, in 24-hour notation, as a two-digit string
FileMIN File creation minute value, as a two-digit string
FileSS File creation seconds value, as a two-digit string
FileModYYYY File modification year, as a four-digit string
FileModYY File modification year, as a two-digit string
FileModMM File modification month, as a two-digit string
FileModDD File modification day of the month, as a two-digit string
FileModHH File modification hour value, in 24-hour notation, as a two-digit string
FileModMIN File modification minute value, as a two-digit string
FileModSS File modification seconds value, as a two-digit string
Filenames, Paths, and Catalog Organization
FullExportedFile When an Export or Publish operation is ongoing, the full path and filename of the exported copy
FullExportedFolder When an Export or Publish operation is ongoing, the full path to the folder of the exported copy
Filename When an Export or Publish operation is ongoing, the filename – without path and without extension – of the exported copy
FILENAME Like Filename, but includes the extension
FilenameNumber

The numeric part of the Filename, e.g. with IMG_1234.jpg, {FilenameNumber} is 1234.

If the filename contains multiple sequences of digits, such as with BODY2_FRAME1234.JPG — which has 2 and 1234 — the longest sequence is used (1234 in this example). If more than one sequence are equally long, the rightmost sequence is used, so with BODY2_FRAME1.JPG the result is 1.

Without an argument, {FilenameNumber} returns exactly that string of digits. However, if you add an argument like {FilenameNumber=####} then the result is padded with zeros (or leading zeros are truncated) as needed to make the length match the number of # in the argument. Some examples:

FilenameTokenResult
IMG_00123.jpg{FilenameNumber}000123
IMG_00123.jpg{FilenameNumber=#}123
IMG_00123.jpg{FilenameNumber=##}123
IMG_00123.jpg{FilenameNumber=###}123
IMG_00123.jpg{FilenameNumber=####}0123
IMG_00123.jpg{FilenameNumber=#####}00123
IMG_00123.jpg{FilenameNumber=######}000123
IMG_00123.jpg{FilenameNumber=#######}0000123
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
FolderPath The full path of the folder in which the master image in the catalog resides
RelativeFolder The part of the full path to the master image that appears in Library's Folder panel. This differs from FolderPath in that it omits the leading part of the full path that leads to the lowest-level folder shown within the Folder Panel.
FolderName

The name of the folder (without path) in which the master image in the catalog resides.

You can also pluck folder names from the hierarchy that the image lies in by counting down from the end:

{FolderName=-1} is the parent folder that {FolderName} is in.
{FolderName=-2} is the parent of the parent of {FolderName}.
{FolderName=-3} is its parent, etc., until you pass the base folder shown in Library, after which the token becomes blank.

(For completeness, {FolderName=-0} is the same as {FolderName})

You can also count up from the root folder shown in the Library Folders panel:

{FolderName=+0} is the name of the most-root folder for the image.
{FolderName=+1} is the next successor that leads to the image.
{FolderName=+2} is the next successor after that, etc., until you get beyond {FolderName}, after which the token becomes blank.

As a concrete example, consider this folder hierarchy shown in Lightroom:

The following examples are for an image in the deepest level (in the Nanzen Temple folder):

Result
{FolderName} Nanzen Temple      
{FolderName=-0} Nanzen Temple
{FolderName=-1} Temples
{FolderName=-2} Kyoto
{FolderName=-3} Japan
{FolderName=-4} Asia
{FolderName=-5} Travel
{FolderName=-6} MyPhotoLibrary
{FolderName=-7} blank
{FolderName=-8} blank
{FolderName=+0} MyPhotoLibrary
{FolderName=+1} Travel
{FolderName=+2} Asia
{FolderName=+3} Japan
{FolderName=+4} Kyoto
{FolderName=+5} Temples
{FolderName=+6} Nanzen Temple
{FolderName=+7} blank
{FolderName=+8} blank

You can leave off the + if you like, so you can refer to the root folder as {FolderName=0} or {FolderName=+0}.

CollectionNames

A comma-separated list of names of non-smart non-publish collections that the photo is part of. (Due to limits in Lightroom's plugin infrastructure, smart collections and publish collections are not considered.)

As an example, a photo of the Eiffel Tower included within the two highlighted collections seen in the screenshot at right produces Monuments, Paris.

You can use a special form where you can dress up each collection name: with our example, {CollectionNames="%s"} results in:

"Monuments", "Paris"

In this special form, the text after the equal sign is used, with the %s marking where the name itself should be placed. In the example, that text is

"%s"

so each keyword gets wrapped in double quotes.

Also see the CN table and the CNf function, available to the special {LUA} token.

CollectionFullNames

Like {CollectionNames} above, but each name is the full hierarchical name of the collection, such as Travel > France > Paris for the Paris collection.

Therefore, our sample Eiffel Tower photo in the screenshot above produces Monuments, Travel > France > Paris.

The special form mentioned with CollectionNames above also works here.

Also see the CFN table and the CFNf function, available to the special {LUA} token.

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.

You can supply an argument to change how the shutter speed and aperture are combined: SS within the argument is replaced by the shutter speed text, and AP is replaced by the aperture text. A bare {Exposure} is the same as {Exposure=SS at AP}.

You might, for example, use {Exposure=SS @ AP} so as to end up with 1/250 sec @ 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.

You can provide an argument to change how the number is displayed; within it, any # is replaced by the ISO sensitivity number. For example {ISO=ISO #} becomes something like ISO 1200 when the photo has ISO data, but becomes nothing when it doesn't. (Compare that to ISO {ISO}, which becomes ISO  when the photo has no ISO data.

Lens The photo's lens information, like 24-70mm f/2.8.
LensInfo

Like {Lens} except that for zoom lenses it also includes the focal length that the photo was shot, such as 24-70mm f/2.8 @ 50 mm.

You can provide an argument to configure how the basic lens info is presented along with the focal length: LENS is replaced by the basic lens info (the same as the {Lens} token), while FL is replaced by the focal-length info. A bare {LensInfo} is the same as {LensInfo=LENS @ FL}. You might instead use {LensInfo=LENS at FL} if you prefer at to @, as in 24-70mm f/2.8 at 50 mm.

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
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.
GPSCoords The photo's geoencoded coordinates in decimal format, such as 40.689253,-74.046694
GPSCoordinates The photo's geoencoded coordinates in degree-minute-second format, such as 35°1'11.51" N 135°46'16.05" E
PlusCode

The Plus Code for the geoencoded location. The default precision is 12, so for the Statue of Liberty {PlusCode} becomes 87G7MXQ4+M5PM.

Use in the form {PlusCode=10} to set more or less precision.

You can get the short form of a PlusCode by providing a reference location; For example, {PlusCode=ref=40.72,-74.00} returns short codes for locations in and around New York City, but long codes otherwise.

You can combine combine precision with a reference location: {PlusCode=10,ref=40.72,-74.00}.

GeoHash The geohash for the geoencoded location.
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
ImageViewDirection The direction that the camera was facing when the image was taken, e.g. North, West, South-East, etc.
ImageViewBearing The compass bearing that the camera was facing when the image was taken, as a number of degrees from North.
SpeedKPH If the photo was geoencoded via tracklog with my Geoencoding Support plugin, this becomes a string like 24.7 kph
SpeedMPH Like {SpeedKPH}, but MPH (e.g. 15.3 mph)
SpeedKnots Like {SpeedKPH}, but in knots (e.g. 13.3 knots)
TempC

If the photo was geoencoded via tracklog with my Geoencoding Support plugin, and that tracklog included temperature information, this becomes a string like 24°C.

If provided the argument raw (that is, {TempC=raw}) then whatever is in the plugin's Temperature field is passed through unchanged (even if it's Fahrenheit).

If any other argument is given, that argument is used, but with each # character in it replaced by the temperature number: for example, {TempC=it was # degrees} might become it was 24 degrees.

TempF

If the photo was geoencoded via tracklog with my Geoencoding Support plugin, and that tracklog included temperature information, this becomes a string like 75°F.

If provided the argument raw (that is, {TempF=raw}) then whatever is in the plugin's Temperature field is passed through unchanged (even if it's Celsius).

If any other argument is given, that argument is used, but with each # character in it replaced by the temperature number: for example, {TempF=it was # degrees} might become it was 75 degrees.

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 A synonym for {State}
Country The Country metadata item
CountryCode The photo's Image > ISO Country Code metadata item in Lightroom's database.
Artwork or Object
Artworks IPTC Extended Artwork or Object records, presented as a comma-separated set of Title/Copyright/Creator/Date/Source/InventoryNum, though missing items are omitted. {Artworks=1} shows just the first recorded artwork, {Artworks=2} shows just the second, etc.
ArtworkTitle The list of Artwork or Object titles registered for the photo, separated by commas. {ArtworkTitle=1} shows just the first title, {ArtworkTitle=2} just the second, etc.
ArtworkCopyright Like {ArtworkTitle}, but for the artwork copyright.
ArtworkCreator Like {ArtworkTitle}, but for the artwork creator.
ArtworkDateCreated Like {ArtworkTitle}, but for the artwork date created.
ArtworkSource Like {ArtworkTitle}, but for the artwork source
ArtworkInventoryNum Like {ArtworkTitle}, but for the artwork inventory control number.
Other Metadata
Artist The Artist metadata item
Caption The Caption metadata string
Category The photo's IPTC > Category metadata item in Lightroom's database.
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.)

Supports special filters:

The ChildOf and DescendantOf filters, used in the form {Keywords:ChildOf=parent} to include only keywords that are direct children of the named parent keyword. (DescendantOf, obviously, allows indirect children as well.)

The H filter has each keyword expand hierarchically, with each level separated by the text argument of the filter. For example, {Keywords:H= >> } might result in a San Francisco keyword expand to USA >> California >> San Francisco.

The HR filter is the same as the H filter, except that the hierarchical order is reversed. Continuing with the previous example, {Keywords:HR= << } might result in San Francisco << California << USA.

Filters can be stacked up to two deep: {Keywords:DescendantOf=USA:H= >> }. However, some combinations of filters won't parse properly, due to my poor design very early on, sorry.

Note: in implementing these special filters, I had to use a different method to access the photo keywords than when no filters are used, and this can result in two differences: one is that without filters, Lightroom includes keywords even if they're not assigned to the photo, if that unassigned keyword has a descendant keyword that is assigned. When a filter is used, only keywords explicitly added to a photo are included.

Secondly, the order in which keywords appear may differ depending on whether filters are used.

If you don't use filters, you can use a special form where you can dress up each keyword: for example, {Keywords=[%s]}) might result in [Paris], [landmark], [tower]. In this special form, the text after the equal sign is used, with the %s marking where the keyword itself should be placed. In the example, that text is [%s], so each keyword gets wrapped in square brackets.

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
People See here.
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.

Urls The list of URLs saved among plugin custom metadata (such as the various URLs listed above), one per line. (An example of this in use can be seen with my Bag-o-Goodies plugin.
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.

Note: this always appears blank in previews shown in the Publishing Manager dialog... it has a value only during an actual publish operation, so while it should work when composing captions and such for uploads, you won't be able to see it until the upload.

You can use arguments like +0 or -3, as described for FolderName, to pluck out specific parts of a publish collection-set hierarchy.

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.

Note: this always appears blank in previews shown in the Publishing Manager dialog... it has a value only during an actual publish operation, so while it should work when composing captions and such for uploads, you won't be able to see it until the upload.

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.

Note: this always appears blank in previews shown in the Publishing Manager dialog... it has a value only during an actual publish operation, so while it should work when composing captions and such for uploads, you won't be able to see it until the upload.

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: {   |   }   "
Hyphen Inserts a hyphen that is never squelched.
Comma Inserts a comma that is never squelched.
Space Inserts a space that is never squelched.
Newline Inserts a newline character that is never squelched; not all fields/usages can properly handle a newline character, so take care.
LUA See the section below for details on this advanced, complex token.
Exiftool=fieldcode

(Currently available only in some plugins: Bag-o-Goodies, Collection Publisher, and Folder Publisher)

Inspects the master image file for the given Exiftool field code. For this token to work, the master image file must be available, of course.

You can see the field codes for a given image file with my Metadata Viewer plugin, by toggling the show field control in the upper right from name to code.

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.

Optional If Exists...

You can have something depend on a value existing in the first place. For example, consider want to put quotes around the caption, as with:

The caption is {Caption}

This produces pleasing results when the image has a caption, but if there is no caption, it produces the result:

The caption is

However, consider the following:

{Caption?The caption is {Caption}}

This uses a special token form:

{ token ? value to use if the named token is not empty }

This produces nothing when there is no caption, but the desired The caption is... value when there is a caption.

Another example is {ISO?ISO{ISO}} which perhaps looks confusing. It produces nothing when the image has no ISO sensor-sensitivity metadata, but text like ISO3200 when it does. The token has three ISO in it: the first is a token name, which, because it is followed by a question mark, means to ignore everything if the token has no value. The second ISO is just text to include in the value, and that's followed immediately by the third ISO as {ISO}, which is a straight-up token to reference the ISO metadata value.

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 nexample, 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
S2X Spaces to Nothing (synonym for the NS filter)
LO Letters Only All spaces and punctuation are removed, leaving only letters (and numbers)
F2D Forward slash to Dash Forward-slash characters (“/”) are replaced by dash characters (“-”)
F2S Forward slash to Space Forward-slash characters (“/”) are replaced by space characters
F2X Forward slash to nothing Forward-slash characters (“/”) are removed
B2D Backward slash to Dash Backward-slash characters (“\”) are replaced by dash characters (“-”)
B2S Backward slash to Space Backward-slash characters (“\”) are replaced by space characters
B2X Backward slash to nothing Backward-slash characters (“\”) are removed
A2D Any slash to Dash Both kinds of slash characters are replaced by dash characters
A2S Any slash to Space Both kinds of slash characters are replaced by space characters
A2X Any slash to nothing Both kinds of slash characters are removed
PF Plain Fractions Converts the typographic fractions found in some metadata to plain ASCII, e.g. converts “½” to “1/2”
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.

evenIfPrivate Forcefully reference a location-related value, even if other privacy-related settings would have excluded it. E.g. even though a photo is geoencoded, {GPSCoords} might be blank if privacy settings elsewhere indicate that the location should not be shared; but even in that case, {GPSCoords:evenIfPrivate} would show the location.

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, LrLocalization, LrMath, LrMD5, LrPathUtils, LrStringUtils, and LrSystemInfo. 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 function uc(item), which gives the upper-case version of whatever is passed to it. There's also ucFirst(item), which uppercases only the first character, and the lowercase versions lc(item) and lcFirst(item).

  • 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 KWf() — the name comes from KeyWord formatting — that does something with each keyword marked for export. Called in the form KWf(formatjoiner), the first argument is text; within that text, the sequence %s is replaced by a keyword. After all such replacements, they're all joined together by the joiner text.

    For example, KWf("[%s]", " -- ") might result in [Paris] -- [landmark] -- [tower], and KWf("%s", "|") might result in Paris|landmark|tower.

  • A table CN that has keys for every Collection Name that the photo is included in (the values are true). Smart collections and publish collections are not considered. Comparable to the {CollectionNames} token.

  • The function CNf() for Collection Name formatting. Used exactly like the KWf() function, but works with items in the CN table.

  • A table CFN that has keys for every Collection Full Name that the photo is included in (the values are true). Smart collections and publish collections are not considered. See the {CollectionFullNames} token for more info.

  • The function CFNf() for Collection Full Name formatting. Used exactly like the KWf() function, but works with items in the CFN table.

  • A table PCH, short for Publish Collection Hierarchy, that contains information about the current publish operation. (The table is empty except during publish operations.)

    If, for example, within a publish service you have a publish collection set named Travel, and within that another set named Asia, and within that, the final collection is Japan, then during publish of Japan the PCH table contains three strings: { Travel, Asia, Japan }

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

  • The special PP(id) pseudo-function that returns the value of the photo's Plugin Property named by the id. For example, PP('info.regex.lightroom.gps.Speed') is the same as the {SpeedKPH} token. Due to esoteric technical limitations in Lightroom, this is not actually implemented as a Lua function, but rather it's pre-detected in the Lua snippet and has its value substituted in place, prior to the Lua snippet being interpreted as Lua code. As such, it's not available within a file imported via load(), so if you want to use it within such a file, you have to cache the value in a variable prior to the load().

  • The table PEOPLE, which includes one entry per person tagged in the photo. Each entry is a table with fields name, nickname, bday (Coco timestamp of their birthday, or nil if not known), ts (Coco timestamp of their birthday, or the current timestamp if not known), and keyword (the LrKeyword object). Most fields will be empty if the person keywords has not been registered via my People Support plugin.

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")}

All 159 comments so far, oldest first...

Would love the possibility of adding a line break 🙂

— comment by Caroline on July 6th, 2008 at 2:10am JST (15 years, 10 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 (15 years, 10 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 (15 years, 10 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 (15 years, 10 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 (15 years, 9 months 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 (15 years, 8 months 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 (15 years, 8 months 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 (15 years, 8 months 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 (15 years, 8 months 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 (15 years, 8 months 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 (15 years, 8 months 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 (15 years, 7 months 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 (15 years, 7 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 (15 years, 7 months ago) comment permalink

This is a really really great feature. Thank you!

— comment by me on September 20th, 2008 at 12:16am JST (15 years, 7 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 (15 years, 7 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 (15 years, 7 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 (15 years, 7 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 (15 years, 7 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 (15 years, 7 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 (15 years, 6 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 (15 years, 6 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 (15 years, 6 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 (15 years, 5 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 (15 years, 5 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 (15 years, 5 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 (15 years, 5 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 (15 years, 4 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 (15 years, 4 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 (15 years, 3 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 (15 years, 3 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 (15 years, 3 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 (15 years, 3 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 (15 years, 3 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 (15 years, 2 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 (15 years, 2 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 (15 years 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 (15 years 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 (14 years, 10 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 (14 years, 10 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 (14 years, 10 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 (14 years, 9 months 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 (14 years, 8 months 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 (14 years, 8 months 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 (14 years, 6 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 (14 years, 5 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 (14 years, 5 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 (14 years, 4 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 (14 years, 4 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 (14 years, 4 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 (14 years, 4 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 (14 years, 3 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 (14 years 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 (14 years 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 (13 years, 11 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 (13 years, 9 months 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 (13 years, 8 months 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 (13 years, 7 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 (13 years, 3 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 (13 years 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 (13 years 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 (12 years, 9 months 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 (12 years, 6 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 (12 years, 5 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 (12 years, 2 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 (12 years, 2 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 (12 years 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 (11 years, 11 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 (11 years, 11 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 (11 years, 9 months 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 (11 years, 8 months 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 (11 years, 7 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 (11 years, 6 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 (11 years, 5 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 (11 years, 3 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 years, 6 months 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 (10 years, 6 months 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 (10 years, 4 months 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 (10 years 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 (9 years, 11 months 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 (9 years, 10 months 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 (9 years, 10 months 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 (9 years, 10 months ago) comment permalink

Hi Jeffrey,

I’m using your Zenfolio publisher to manage content on my zf site. I’m doing something on a zf custom page that would benefit from a generated unique ID (not too long) in the Caption of the uploaded photo. I do not want it to be reverse engineerable so concatenating tokens is too simple. Can you think of a way to generate something like “a13nASibDreRi3485u” (i.e. a seemingly random string) which is guaranteed to be unique with LUA?

Also, can I write to any other metadata fields at the time of publishing using your token system?

Thanks for the great plugins!

Alec
Cape Town

The UUID token is globally unique, but perhaps is a bit long. You can write to any metadata field by calling out to an ExifTool command, perhaps with my run-any-command plugin. —Jeffrey

— comment by Alec Smith on September 18th, 2014 at 10:52pm JST (9 years, 7 months ago) comment permalink

Hi Jeffrey,

In the Facebook plugin’s Metadata Management section, Sublocation/the {Location} token, City, State, and Country tokens are showing up blank in the Token Samples view and in the Example under the Caption preset setting window. Those caption fields are also blank on the final Facebook posting. However, when using those fields for filename in the File Naming Rename to: section, those values are read correctly and showing up in “Example:”. I had several caption presets for Image Caption under the Facebook:Metadata Management section, but upgrading (Lightroom? Or the plugin?) at some point may have reset the drop-down as all the presets I previously created disappeared, but not sure if that’s related? Do you have insight on the missing tokens in the caption?

Thanks,
Jen
California

Check the “Location Privacy” section of the dialog. I suspect the location has been marked “private” in the Map Module, and in the “Location Privacy” section it’s set to respect that WRT my plugins tokens. It’s a setting you can change. —Jeffrey

— comment by Jennifer L on October 31st, 2014 at 2:11pm JST (9 years, 6 months ago) comment permalink

Jeffrey,

Thanks for the suggestion to check “Location Privacy” for the tokens issue. The locations weren’t marked private for the images, but unchecking “unless metadata excluded” for Sublocation, City, State, and Country fixed it; I had metadata setting set to include “Copyright & Contact Info Only”.

Jen

— comment by Jennifer L on November 3rd, 2014 at 3:45pm JST (9 years, 6 months ago) comment permalink

First of all, a big thank you to Jeffry for making these plugins and supporting users in this way. The plugings are really great and make the workflow in Lightroom so much easier.

Now I’d like to share a tip. I was looking for a way to include double line breaks. After some try and error I found a way and I’d like to share it with you.

To make a double line break, you’ll make the first line break, make a white space character, and then the second line break.

type
make a white space character by holding down ALT then type 0160 (Alt+0160) on the number keypad at the right side of your keyboard.
type

Hope this is helpfull.

— comment by Tore Setre on February 11th, 2015 at 8:13am JST (9 years, 3 months ago) comment permalink

Hi Jeffrey,

Congratulations on an amazing collection of plug-ins. I bought a fair few of them and use them regularly.

For this project I’ve been using the folder publisher and I’d like to know if there’s any way of using enhanced file naming to export to different sub folders base on date added (the date of the import). I’ve been scanning old slides so the capture date is usually unknown but it would be useful to view collections in the batches I added them.

Many thanks,

Ken

Unfortunately, no, Lightroom doesn’t make that date available to plugins. —Jeffrey

— comment by Ken Davies on February 28th, 2015 at 1:38am JST (9 years, 2 months ago) comment permalink

A couple of questions:

1. Anyway to connect Lightrooms People to Google Photos Faces?
2. I have the People plugin along side the Picasa plugin to upload to Google Photos. I notice the {People} tag only shows up if you set a birthday on each of the People. The people lightroom plugin finds all the people but it appears to only expose them to the {People} tag if the birthday is set on a given “person.” Am I missing something here to help just get the names/faces of people in a photo to show up in Google Photo’s meta data?

The goal is to use Lightroom to set the people and then upload to Google Photos. I would love for the faces in Google Photos to be tagged via the Light room data but update the web site on Google.

I can get the {People} tag to show up as “random” meta data, but only if you set a birthday. And I can’t get it to set the Face tag in Google from lightroom. It sounds like this is supported in Facebook.

Thanks for these plugins! They are really cool.

corban

Now way to connect faces to Google yet… hopefully they’ll create an API. About the {People} tag, doh! I forgot to update that for Lr6. Will do so soon. I had indeed updated the plugin so that {People} should work with Lr6, so if it doesn’t seem to be working, please send a log with specifics about exactly which keywords are not working as you expect. —Jeffrey

— comment by corban gossett on June 8th, 2015 at 12:05pm JST (8 years, 11 months ago) comment permalink

Hello Jeffrey,

Any token for the original filename. You do have for time and date but not for the filename.
Can you add this. Userful to match exported to original in any publisher service.
Let me know

Best
Thales

If by “original” you mean the name of the master image on disk, that’s LIBRARYFILENAME. If you mean “some other name the master file had some time in the past”, that’s not something the plugin could know. —Jeffrey

— comment by Thales Martins on August 4th, 2015 at 8:06pm JST (8 years, 9 months ago) comment permalink

Jeff:

Great stuff here.

Here’s my challange: upon import into LR, I rename all of my image files {Import Date} {Shoot Name} {Original Camera Filename}. So, for instance, the Nikon image DSC1101.NEF which I shot on August 1, 2015 during my day at the Zoo would become “20150801 Zoo DSC1101.NEF”.

When I publish on Flickr, the images are grouped differently and I’m not especially interested in displaying the shoot name, yet I want to be able to easily identify the image in LR. I’m using the LR Caption as the Flickr Title, which works well. I’d like to use the Capture Date plus the Original Camera Filename as the Flickr Caption. The problem being I can’t find the Original Camera Filename in the tokens. If there was a way to extract the rightmost portion of the LIBRARYFILENAME up to the first space, I could do this.

Possible?

Thanks,
Scott
New Jersey, USA

Lightroom doesn’t give plugins access to prior filenames, so the best you can do is try to extract it from the current filename, with something along the lines of {LUA=LIBRARYFILENAME:gsub('^.* ', '')}. Be sure to copy-and-paste exactly… the exact spacing and quote types are important. —Jeffrey

— comment by Scott G. Abbey on September 12th, 2015 at 5:51am JST (8 years, 8 months ago) comment permalink

can i use LUA to specify watermark to be used during folder publish? e.g. reading watermark name from keyword or some metadata?

Unfortunately, no, Lightroom bakes the watermark into the exported copy before giving control over to the plugin. If the number of watermarks is not huge, you might consider a different publish service for each one. —Jeffrey

— comment by pman on November 28th, 2015 at 10:00pm JST (8 years, 5 months ago) comment permalink

Hello Jeffrey,

any solution to export a photo with replacing the Master File? I know that Lightroom is non-destructive but I need this option to prevent Duplicates.

I tried this without success:
Command to execute for each exported picture: copy “{FILE}” “{Path}\{LIBRARYFILENAME}”

Command to execute upon export completion: del {FILES}

Thanks

I know that there are as many different workflows as there are people, but I can’t imagine that what you’re trying to do is a Good Thing. At best you’d be destroying your original files; at worst you’d corrupt your Lightroom catalog. —Jeffrey

— comment by drgraph on January 14th, 2016 at 1:34am JST (8 years, 3 months ago) comment permalink

I am resubmitting this because I did not have the Notify box checked, and I will need a notification.:
Thanks for the plugin work that you do. I am trying to use your Metadata Wrangler to be able to export video files and preserve their original Capture Date in the metadata of the export (Lightroom does show their original capture date in the Metadata). I have the plugin installed, and I have all the boxes in the Extra Options section checked (and everything else set to Preserve). The resulting video file export shows “Created” date as today, but the “Modified” date as the original video file creation date which is what I want the “Created” date to be. Can you help shed some light on this?

Video-file metadata is not nearly as standard as for photos, so all bets are sort of off. If you can email a very short sample video file (short like half a second or one second), or a link via Dropbox, I’ll do some testing. —Jeffrey

— comment by Kris P Yust on February 7th, 2016 at 8:24am JST (8 years, 3 months ago) comment permalink

Is there a way to use other plugin’s properties (similar to PluginProperty) within a {LUA } block? I wanted to check if the property is non-empty and include it with some text if it is.

No, unfortunately, Lightroom’s thread design for some reason limits certain kinds of database calls from certain situations, and this seems to be one such situation. I added the code to make the call, but it yields an error that I can’t work around. )-: —Jeffrey

— comment by Hordur on February 29th, 2016 at 2:28pm JST (8 years, 2 months ago) comment permalink

Hi,
Your plugins are a lifesaver for us!
Is there a way to retrieve a list of the collections an image is assigned to?
I’m trying to work out a simplified way of publishing multiple collections. Collection mirroring seems like it might be right answer, but I am unnerved by the number of warnings that came with that feature. Also, I noticed that the mirrored collection is not updated if collections are added or removed from the original set.
A simpler setup for us would be if we could just use an image’s collection name to set its path using your advanced renamer — then we wouldn’t need the mirror set! The rub is, I don’t see a “collection” token.
Thanks for your help!
Best,
Donald Newlands

The whole “collection mirroring” thing is one of those things that Adobe could so easily build into Lightroom, but which it’s really hard for anyone else to do. The idea of a “collection” token is interesting, but comes with lots of practical problems… what to do when an image is in multiple collections? Or no collections? For some reason, Lightroom doesn’t allow a plugin to list the collections an image is part of… the plugin would have to scan the entire catalog looking for matches. (My Data Explorer plugin offers exactly that feature.) —Jeffrey

— comment by Donald Newlands on March 3rd, 2016 at 2:35am JST (8 years, 2 months ago) comment permalink

Hi Jeffrey! I’ve just started to use your plugin, and it’s doing wonders for my workflow 🙂
I wanted to know if it’s possible to add “Flag Status” to the “Metadata that triggers republish” section?

I mark all of my edited photos as Picked, and since I have the flag status in the “Enhanced file renaming” section, it would be really helpful if picking a photo would cause a republish, so the filename would get updated in the publish service once a photo has been edited.

Would it be possible for you to add that?
Thank you!

Ligthroom is full of “Metadata that triggers republish” errors, so even if Adobe adds it (which I doubt they will… they have not made any updates since it was first released, despite many bug reports and feature requests), it probably wouldn’t work reliably. )-: —Jeffrey

— comment by Shlomi Cohen on March 3rd, 2016 at 4:11am JST (8 years, 2 months ago) comment permalink

Greetings from Richland, WA, USA.

I am trying to create a metadata template that extracts the Sulocation field. Using version 20160307.282 with LR 6.5 on a OS X 10.11.3

I’ve tried a bunch of different plugin IDs using the Event token as a test and can’t get any to work. Here are a couple of examples using the Sublocation field name:

{PluginProperty=zenfolio-jfriedl.lrplugin.Sublocation}

{PluginProperty=IDinfo.regxlhtmpz2LPuU.Sublocation}

That last ID was pulled from a *.lua file.

In any case, what is the proper plugin ID for Export to Zenfolio, the proper syntax, and the proper field name to use?

The “sublocation” field is not a plugin-specific field… it’s part of Lightroom. It’s {Location}. —Jeffrey

— comment by Paul on March 19th, 2016 at 6:36am JST (8 years, 1 month ago) comment permalink

Hi Jeffrey,
Many thanks on the plugins, you are the go-to guy on all things lightroom in my mind.

Im looking to add gps location onto images from another already geotagged photo with the same folder.

Essentially, when you were to drop an image into the folder the plugin is scanning, it would automatically geo-tag the image, and move it into another folder. ( possibly one connected to google earth to then display the images on a map module accessible to more than just the lightroom user.)

Is it possilbe to do this using Lua to copy location data from one image to another?

Many, many thanks,

Tom

It all sounds possible, though you’d have to develop your own plugin to do it. My Geoencoding-Support plugin can copy the location info from one image to others, but it’s manual, not automated as you describe. —Jeffrey

— comment by Tom on April 15th, 2016 at 8:32pm JST (8 years ago) comment permalink

Greetings from London.
Hi Jeffrey – I hope you dont mind me asking the most basic of questions. Im very new to the world of Lightroom but have found a couple of your Plug-Ins to be really helpful.
Im about to attempt to use the People Support to add ages to the metadata. I saw on the details you provided that this is possible through a template token add on but I dont know where to download this from.

You see – I told you it was basic 🙂
Thanks in advance
Levi

The data is access via the template tokens that many of my plugins allow for various data fields; the data is added via my People Support plugin. —Jeffrey

— comment by Levi on June 3rd, 2016 at 5:46am JST (7 years, 11 months ago) comment permalink

Hi Jeffrey,

ust wanted to say thank you for putting all this amazing info together and many thanks for all these great plugins. So much info will have to digest. Well done, thank you and have an amazing week.

Kindly Simon

— comment by Simon on August 9th, 2016 at 2:59am JST (7 years, 9 months ago) comment permalink

Great plug ins. I’ve been a fan for a while. With the facebook plug in, is there a way to take the LR keywords and have the plug in apply hashtags before each word as in the caption? (example: keywords: portraits, popular, family result: #portraits #popular #family)

You can do it by setting the caption in the plugin to a template with the following:

{Caption} {LUA=x=TBL() for k in pairs(KWE) do table.insert(x, '#'..k) end; return table.concat(x, ', ')}

The {Caption} in that represents the “Caption” metadata field. The rest is a LUA token to put the exportable keywords as you asked. However, while testing this for you I found a bug in the plugin, so be sure to update to the latest version first. —Jeffrey

— comment by Adam on October 18th, 2016 at 8:11am JST (7 years, 6 months ago) comment permalink

Is it possible, in a photo caption to tag a Facebook Page (or person) so that when it’s uploaded to Facebook, it is understood as a tag and not just caption text?

You can tag people this way, via my People Support plugin. Other things, sorry, no. —Jeffrey

— comment by Andrew on October 31st, 2016 at 1:00pm JST (7 years, 6 months ago) comment permalink

Thanks for the awesome plugin. Is there a token for the IPTC extension field Artwork Title and Artwork Creator. Or a way to invoke them using the PluginProperty option? I have a bunch of photos that I’ve populated the Artwork fields but unfortunately most of the image viewers around are restricted to the basic fields. Which leaves me to look at options of copying the Artwork Title to the Title and the Creator in the caption. Thanks in advance.

I’m not sure which plugin you’re using, but I’ve gone ahead and added tokens for the “Artwork or Object” data. To copy things over within Lightroom you might consider the “Write Field” feature of my Bag-o-Goodies plugin, or perhaps stuff the data in during export with Metadata Wrangler. —Jeffrey

— comment by Vaishakhi on March 8th, 2017 at 8:48am JST (7 years, 2 months ago) comment permalink

I’d like to be able to upload images to specific Flickr albums based on keywords.

Can this be done using tokens?

Not with tokens, but you can make keyword-based Smart Publish Collections that target specific FB albums. —Jeffrey

— comment by Rantz on May 20th, 2017 at 3:22pm JST (6 years, 11 months ago) comment permalink

How can I get trim start (/ trim end) from video?

Thx for best plugin.

What’s your use case? How would you like it to become available? (Do you want a count of seconds (to how many decimal places?)?, a frame count? Some kind of English description?) —Jeffrey

— comment by JV on June 16th, 2017 at 7:10am JST (6 years, 10 months ago) comment permalink

Hey Jeff,

Thx for this Plugin. You have listed the “Newline” token here but when I want to use it on my template Newline is not recognized.

My Version: facebook-20170403.401

Thy for your help

Oops, sorry about that, I hadn’t pushed out all the affected plugins yet. I’ve just updated the Facebook plugin. —Jeffrey

— comment by Björn on June 17th, 2017 at 3:09pm JST (6 years, 10 months ago) comment permalink

Hello for North Carolina

So appreciative of all your plugins – they make life so much easier!

I have a question on tokens and how to make an exclusion. For example, I am using {country} as a token in the folder watch caption but I would like to exclude the United States. Is there a way to do this?

Thank you in advance.

You can do this kind of thing with the LUA token, which gives you programmatic access to the data: {LUA=Country == "United States" and "" or Country} —Jeffrey

— comment by Angie on July 7th, 2017 at 2:56am JST (6 years, 10 months ago) comment permalink

Hi Jeffrey,
First, thank you very much for this plugin, it’s a real life saver!

I’d like to rename my photos using my collection structure, as it seems to be possible with the folders (with the =+8 for the 8th level of hierarchy for example).
Is it possible to add a token like this?
Thanks in advance and keep up the good work!

No, sorry, not easily possible at all. Lightroom doesn’t give a plugin easy access to the list of collections that a photo might be in, but even if it did, what should be done when a photo is part of more than one collection? It would be computationally-intensive just to get to the point of this can of worms, so it doesn’t seem worth it. —Jeffrey

— comment by Guillaume on August 22nd, 2017 at 5:46am JST (6 years, 8 months ago) comment permalink

Hi
I created batch file that continue to some actions after export finish.
and i add in the last action that when it finish it will show me msgBox.

While i’m running it from command line it’s work great.

when i’m running it from the plug in all actions working except the msgbox in the end.

do i have a way to let it work?

thanks
Avi

It’s difficult to guess, but make sure you’re using quotes properly on the command line. Perhaps send a plugin log after encountering the error. —Jeffrey

— comment by Avi on August 30th, 2017 at 2:52am JST (6 years, 8 months ago) comment permalink

I’m seeing that the various filename tokens that claim to return a value “without path” do indeed include the full path for the file. (Using Run Any Command.)
Ferg — Bellevue, WA

Would you mind sending a plugin log after encountering the problem? Thanks. —Jeffrey

— comment by Scott Ferguson on September 2nd, 2017 at 4:16pm JST (6 years, 8 months ago) comment permalink

Hi, I’m trying to use the following line to title files published to Zenfolio but it’s not working. I’m thinking it’s something to do with the result from the :find method. I’ve searched on the LUA wiki but haven’t been able to figure the correct syntax. Any help would be appreciated.

{LUA=if LibraryFilename:find(“HDR”) ~= nil then return sprintf(“H-”) else return sprintf(“”)end}

Many thanks

Paul, London

The underlying problem is that you’re using “smart” quotes instead of simple ASCII quotes. That’s compounded by a bunch of technically-unfortunate issues with Lightroom and Lua that conspire to render the error message from the plugin invisible. I’ve spent all morning working around that and future versions of my plugins will at least display an error message.

So, replace the smart quotes with ASCII quotes (e.g. “HDR” with "HDR") and you’ll be fine.

Furthermore, you don’t need the calls to sprintf(), since you’re not using any of its formatting features (the “f” in “sprintf”).

Thus, you can use {LUA=if LibraryFilename:find("HDR") then return "H-" else return "" end}

But while we’re at it, you can also simplify it to {LUA=return LibraryFilename:find("HDR") and "H-" or ""}

—Jeffrey

— comment by Paul on September 21st, 2017 at 10:35pm JST (6 years, 7 months ago) comment permalink

Hello Jeff,
I was wondering if there is a way to extract the date and time from whatsapp images name and put this in the lightroom field of “Date Time Original”.
For example the file name is “WhatsApp Image 2018-04-25 at 00.44.58.jpeg” and I want to extract the “2018-04-25 at 00.44.58” and fill the “Date Time Original” with this information.
I think that this a useful procedure when your have a lot of whatsapp images and are importing them to lightroom.
Let me have your thoughts about it and how to create this procedure.
Regards,
Thales

Sadly, a plugin can’t update Lightroom’s idea of the photo date, so you have to do it with Lightroom’s date-changing UI, or perhaps inject the date metadata into the file before importing it into Lightroom. —Jeffrey

— comment by Thales on April 27th, 2018 at 2:35am JST (6 years ago) comment permalink

Dear Jeffrey,
Excellent work with this Facebook plug-in.

I am in need of a “Date Created” (IPTC “Created Date” #055) variable as a Token in the Metadata Mangement. I also would like to have an option to have this self choosen “Date Created” as the Time Stamp on images published to FaceBook.

To be used for publishing scanned historical images.

Thank you in advance,
Leif Drastrup

I’ve added the token ({IptcDateCreated}) to the version I just released. The timestamp thing will take more time, though. —Jeffrey

— comment by Leif Drastrup on May 7th, 2018 at 8:17am JST (6 years ago) comment permalink

I am using the Enhanced File Renaming feature in Collection Publisher. My Filename Template value is

{LUA= load(“/Users/pearsonb/Documents/Adobe/Lightroom/PublishFileRenamingX.lua”) }

and the PublishFileRenamingX.lua file contains the following:

function x()
return “Brian”
end
return x()

and I am getting the following results in the Example field:

bad argument #1 to ‘?’ (function expected, got string)

This used to work just fine; I don’t when thing changed… after an update of LR or Collection Publisher.

Note, the example here is a simplified version of my ‘production’ code; I dummied it down for this comment.

I am running LR 7.3.1 on Windows 10. Any suggestions?

Goodness, that’s my fault, sorry. Law of unintended side effects from another change. Good catch. I’ve pushed out a fixed version. —Jeffrey

— comment by Brian Pearson on June 6th, 2018 at 11:26am JST (5 years, 11 months ago) comment permalink

Hi,

i don’T know why this expression doesn’t return the result keyword, but with this i’ll get either nothing or it fits almost every keyword. Where is my fault ?

if ({IfKeyword=Landschaft;}==”Landschaft”) then
xt=sprintf(“%s %s”,xt,”#landscape”)
end

ciao tuxoche

You’re combining token expressions inside Lua code (which is inside a {Lua} token), which doesn’t work. If you want “#landscape” when the “Landschaft” keywords is applied, then just use {IfKeyword=Landschaft;#landscape}. —Jeffrey

— comment by Peter Marbaise on June 16th, 2018 at 12:38am JST (5 years, 10 months ago) comment permalink

Hi,

I’d like to run some {LUA} code with the “Run Any Command” plugin, but whatever I try, it fails.

I tried the very same function as Brian posted back in June (http://regex.info/blog/lightroom-goodies/template#comment-58089) .

For instance in a custom commad :
echo ‘{LUA= load(“/path/to/my/script.lua”)}’ >> “{desktop}/test.txt”

where script.lua is
function x()
return “Brian”
end
return x()

It fails with this message: Runtime Error: bad argument #1 to ? (function expected, got string)
but the same token works with the “Collection Publisher” plugin.

Any idea ?

Thank you

macOS Sierra 10.12.6
Lightroom Classic CC 7.4
Run Any Command Export Filter 20180527.99

It’s working for me… are you sure that you’re using “dumb” quotes, and not the smart quotes that my blog uses when displaying comments? If you cut-n-paste, you have to go through and update both single and double quotes to be the old dumb kind used in programming. (Also, in your script, you don’t need to use a function… you can just have your code ending with the “return” line. m—Jeffrey

— comment by Emmanuel Thiry on August 16th, 2018 at 12:14am JST (5 years, 8 months ago) comment permalink

Is there a way to combine S2U, LO and LC? I’m looking to achieve the following:

Title: Waterfall next to a mountain in Medellin, Colombia
Output file: waterfall-next-to-a-mountain-in-medellin-colombia.jpg

What you want here is too complex for that, so your best bet would be to do it in Lua: {LUA= Title:gsub('[%W]+','-'):lower() .. ".jpg" } —Jeffrey

— comment by Dan Gold on October 19th, 2018 at 12:12am JST (5 years, 6 months ago) comment permalink

Hello,

i am a beginner.

Are the following things possible with the plugin “Run any Commads”?

During the export with a command to convert uppercase letters in the file name to lowercase?

And is it possible during the export to let umlauts erupt through them?

Or does something work with another plugin?

Many Thanks. Thomas

Umlauts should be preserved during case conversion. If you see some error, please send a plugin log with a note about exactly what is happening, and how it’s different from what you expect. Thanks. —Jeffrey

— comment by Thomas on October 20th, 2018 at 8:32pm JST (5 years, 6 months ago) comment permalink

Jeffrey,

is it possible to add the name of the export setting which has been used for export?

BR,
René

Do you mean the name of the Export Preset used to launch the export? That’s not communicated to the plugin at all. In theory the plugin could look at all your export presets and check all the settings to see which presets have settings that match the current export, but this would be dicey to begin with, and there could be multiple matches and the plugin would have no idea which one was actually used, or even whether a preset was used to begin with. I’ll probably not be adding this to my todo list, sorry. —Jeffrey

— comment by Rene on January 22nd, 2019 at 4:26am JST (5 years, 3 months ago) comment permalink

Hi Jeffrey. Thanks for your brilliant plugins.

I’m using your Folder publisher plugin and I’m trying to get it to include keywords below a certain parent keyword to be included in the file name, up to a set maximum length. For some reason this doesn’t seem to work.

Here’s what I’ve put into the Enhanced File Renaming:
{Filename} {Keywords:DescendantOf=NAME:Length=194}

The point is to include people’s names in the filename, but without breaking the maximum character limit in Windows.

Would be very greatful for any suggestion as to how I could do this.

I had a bug that stopped the standard filters from working with the keyword-special ones; I’ve just pushed a new version of the plugin that fixes it, so your example should then work. Thanks for the report. —Jeffrey

— comment by David Naylor on March 5th, 2019 at 3:39am JST (5 years, 2 months ago) comment permalink

Just started using “extended search” plugin. I must be doing some thing wrong. If trying to search for {MM} how to I tell it to limit to a certain month like 02?

The plugin is great and all other search functions are working correctly except for the token search area. I know it is something I am doing wrong.

Every time I try it returns every picture into the new subset regardless of whether the token is matched or not. It must be how I am telling it to restrict the set.

Thanks

I’m not sure what you’re trying to do… the “Template Text” row has only “is blank” and “is not blank” as conditionals on the template you provide. You can use my Data Explorer plugin to partition photos by the month they were taken in, among much else; perhaps this will suit your needs? —Jeffrey

— comment by Kim Sloan on March 24th, 2019 at 8:23pm JST (5 years, 1 month ago) comment permalink

Hello! I really need your help. I use the plugin ” run-any-command”.
Code that execute:
“{home}\AppData\Roaming\Adobe\Lightroom\Software\ImageMagick\convert.exe” “o:\OneDrive\Work_Lightroom\logo\_for_ViewBug_{PluginProperty=lr.CustomMetadata.DMI_Side}.png” -channel RGB -fuzz 99% -fill #000000 -opaque black “{folder}\000000.png” && “{home}\AppData\Roaming\Adobe\Lightroom\Software\ImageMagick\convert.exe” “{folder}\000000.png” -fill #{LUA= load(“C:/Users/ADrobkov/AppData/Roaming/Adobe/Lightroom/SingleFile/ColorMain.lua”)} -font Rosarina -pointsize 61 -annotate +18+54 “DROBKOV” -fill #{LUA= load(“C:/Users/ADrobkov/AppData/Roaming/Adobe/Lightroom/SingleFile/ColorMain.lua”)} -font Rosarina -pointsize 27 -annotate +232+84 “FOR” “{LUA= load(“C:/Users/ADrobkov/AppData/Roaming/Adobe/Lightroom/SingleFile/ColorMain.lua”)}.png” && “{home}\AppData\Roaming\Adobe\Lightroom\Software\ImageMagick\composite.exe” -dissolve 90 -geometry +1000+100″{folder}\{LUA= load(“C:/Users/ADrobkov/AppData/Roaming/Adobe/Lightroom/SingleFile/ColorMain.lua”)}.png” “{FILE}” “{FILE}”

Swears on the line: {LUA= load(“C:/Users/ADrobkov/AppData/Roaming/Adobe/Lightroom/SingleFile/ColorMain.lua”)}
Error: Runtime Error: “import” unknown

Tell me, is there a way to fix this? I’m not a programmer, do everything to search the Internet, but here I can not understand how to do

— comment by Alexander on March 25th, 2019 at 12:27pm JST (5 years, 1 month ago) comment permalink

Forgot to attach file:

local LrApplication = import ‘LrApplication’
local catalog = import(“LrApplication”).activeCatalog()
local targetPhoto = catalog:getTargetPhoto()

function ColorMain()

color = targetPhoto:getFormattedMetadata (“ImageCreator”)[1].ImageCreatorImageID
return color
end

return ColorMain()

Yes, sorry, import is not supported by the {LUA} token. There’s currently no way to get at the ImageCreator table from a LUA tag, sorry. —Jeffrey

— comment by Alexander on March 25th, 2019 at 12:29pm JST (5 years, 1 month ago) comment permalink

Hello Jeffry,
my Lightroom setup relies heavily on your plugins, but I have a few issues with “FolderWatch”:
1st: is it possible to backup my configuration because I’ve already lost my Lightrom config a few times.
2nd: When importing Videos, the timestamp for the filerename is usually wrong. How can we find the issue? I know, Lightrom itself has massive problems with file-rename of videos depending on the timestamp “video created”
3rd: I know, it is possible to watch more than one folder – but is it also possible to move into according subfolders during import?
Thank you!
The configuration is saved in your Lightroom Preferences. If some part of your preferences are suddenly lost, they might be going corrupt, so please see this FAQ. I highly recommend Matt Dawson’s LR Backup plugin to save a copy of your preferences (and other non-catalog data files) on a regular basis. About video times, given Lightroom’s atrocious handling of them, and Adobe’s apparent lack of caring, I feel it’s a lost cause. )-: I don’t understand your third question, sorry. Feel free to mail me with more details. —Jeffrey

— comment by Peter Baumgartner on April 5th, 2019 at 6:58pm JST (5 years ago) comment permalink

Can you tell me if you have a Lightroom CC plugin that will produce a list of images’ titles, filenames, and whatever else the US Copyright Office is requiring to register my images?
Thank you!

“Lightroom CC” doesn’t allow for plugins. “Lightroom Classic CC” does, so if that’s what you actually mean, check out Lr/Transporter. —Jeffrey

— comment by David Levin on April 11th, 2019 at 9:57am JST (5 years ago) comment permalink

Is there any chance to add the hashtags by the instagram plugin?

Depending on how that plugin works, you may be able to access them via the {PluginProperty} tag —Jeffrey

— comment by Tom on May 27th, 2019 at 3:50am JST (4 years, 11 months ago) comment permalink

Hi Jeffrey,
I was looking through this list of tokens to try and find one which would output the day of the week on which the photo was taken, as a localised string (eg. “Wednesday”) – but I couldn’t find one.

Then, by luck, I tried using {Weekday} in the Metadata Wrangler plugin and it worked!

Therefore I wonder if you could add this token to the list on this page, so it’s documented and there for future reference? 🙂

Thanks!

Oh no, it turns out that the docs were missing {Wday} and {wday} and {weekday} as well. Now I’m worried about what else they might be missing! Thanks for the catch. —Jeffrey

— comment by Jeremy on July 18th, 2019 at 1:06am JST (4 years, 9 months ago) comment permalink

Hello Jeff,

I tried to understand your example of “The special {NOJOINERS} token”, but I couldn’t. Can you provide me with another and be more clear? What is the span? is a token? A field?

Another thing:
On the zenfolio Metadata Management section, I want to create a preset for the Title somehow like this:
{Title|Headline|Filename} – {JobIdentifier} – {###},
but if the value of {Title} is equal to the value of {JobIdentifier} I want to exclude the JobIdentifier, otherwise, the information will be in double.
The result will be something like this if {Title} is equal to the value of {JobIdentifier} the output will be:
{Title|Headline|Filename} – {###}
I tried to figure it out but nothing seems to handle this case. Maybe a code in LUA could handle the situation, but I don’t have any knowledge of LUA language.
Can you provide me with some guidelines to handle this situation?
Thanks

Basically, any joiner characters (such as spaces and hyphens) found on either side of a {NOJOINERS} tag are removed. The “Paris” example in the docs would end up, after filling in {City} and the empty {State}, with {NOJOINERS}Paris, {NOJOINERS}. The first {NOJOINERS} has no effect because it doesn’t end up with any joiners touching it, but the second would cause the comma and space to be removed.

Ab out the JobIdentifier thing, that’s a difficult thing to solve in the general case… your specific use case is not likely shared by anyone else. That’s why I allow general programming via the {LUA} tags. In your case, you probably want something like

{LUA= A=Title or Headline or Filename return A==JobIdentifier and A or  A.."-".. JobIdentifier} - {###}

—Jeffrey

— comment by Thales Martins on August 2nd, 2019 at 2:55am JST (4 years, 9 months ago) comment permalink

Hi Jeffrey! I noticed a problem using the SST1 variable, it doesn’t work! 🙂
I get “Unknown token “SST1” but SST2 and 3 work fine.

Geez, I’m not sure what drugs I must have been on. I think SST2 was broken in that it gave the same result as SST3. In any case, during a moment of clarity I think I’ve fixed them for most of my plugins. (A few still need updates; let me know if I’ve not updated the one you need.) Thanks for the report. —Jeffrey

— comment by Chris on August 7th, 2019 at 1:23pm JST (4 years, 9 months ago) comment permalink

Hi – love this plugin – thanks so much. Is there an escape character such that i can include brackets in the command, such that I can use exiftool commands that themselves require (as far as i know) braces (e.g., “-subject<${subject;NoDups}")? If no escape character, any clever syntax I can use to get around the issue of the plugin trying to recognize the brace as signaling a token? Thanks so much!

Unfortunately, no. The way that the token language evolved over time has left it quite fragile, and so I’m reticent to make big changes. There may be a way around it (perhaps using a file holding exiftool args), but I suppose it depends on how you’re using it, and what you want to acheive. Perhaps drop an email with more info… —Jeffrey

— comment by Rob on October 9th, 2019 at 2:01pm JST (4 years, 7 months ago) comment permalink

Hi Jeffrey,

I am trying to add the keywords into the filename by using the Enhanced File Renaming feature, but the {Keywords} is retured with comma, is there anyway to use the “-” instead?

Here is my template:
{YYYY}/{City}{“-“}{YYYY}{MM}/{YYYY}{MM}{DD}-{Title:NS}-{LUA=return KWf(“%s”, “-“)}

I saw you have a function call KWf() can format the keywwords like “Paris|landmark|tower”, and should be load like {LUA= return KWf(“%s”, “-“)}, but this is not work and I am unable to save the settings.

One more question, Is it possible to remove the joiner if the previous value does not exist, for example, in this {YYYY}/{City}{“-“}{YYYY}{MM}, if the {City} is empty, how can I remove “-” after?

Can you please give me some idea how to do this via Enhancement File renaming?

Thanks, George

Your first template example works for me. Perhaps send a plugin log when it fails for you so that I can check it out. For the second thing, use {City?{City}{"-"}} —Jeffrey

— comment by George on October 24th, 2019 at 3:49pm JST (4 years, 6 months ago) comment permalink

Thanks for your help, no idea why but the syntax {LUA=} is works after I re-install the Adobe Lightroom and the plugins,

Regards, George

— comment by George on October 26th, 2019 at 4:16pm JST (4 years, 6 months ago) comment permalink

Hello Jeffrey,
while struggling to create an exiftool command line to be used with your “Run Any Command” plugin I was stumbling over the comment from Rob on this page (from October 9th 2019). I have the same need as he has, creating an exiftool command which contains curly braces like in “-subject<${keywords}”. As this interferes with your template token language, and there seems to be no way to escape those braces, I am using this {LUA=} token to work around this limitation:

{LUA= ‘”‘ .. “-subject<${keywords}” .. ‘”‘} with “dumb quotes” of course.
Maybe this could be helpful for others too.

However, if we had some special tokens like {{} and {}}, which just yield a { and } would make things easier.

Best regards

Jacques

— comment by Jacques on November 10th, 2019 at 1:17am JST (4 years, 6 months ago) comment permalink

Is there a way to make the whole path lowercase, I can get the filename lowercase, but I need the whole path lowercase

I’m not sure which path you’re referring to, nor in what context, but (for example) {FullExportedFile:LC} gives the full path of the exported copy, lowercased. —Jeffrey

— comment by Rob den Braasem on January 8th, 2020 at 7:05pm JST (4 years, 4 months ago) comment permalink

Is there a way to create a preset to invoke “apply personalised auto tone”?
This would be ideal in combination with the new camera raw default settings on import.
Thanks, Edwin
(Solothurn Switzerland)

No, sorry, Lightroom doesn’t allow for it. —Jeffrey

— comment by Edwin on February 29th, 2020 at 7:17pm JST (4 years, 2 months ago) comment permalink

Hi, I am very happy with your tool. But know I have to solve a big problem.
I need to change some special german charactes during export in the filename and Foldername.

E.g. \Brüssel Äpfel\Brüssel Mögen Tour.jpg

should be exported as:

\Bruessel Aepfel\Bruessel_Moegen_Tour.jpg

So, all spaces should be “_” and some characters have to be changed. “ä” “ö” “ü” “ß” “+” “&” should become “ae” “oe” “ue” “ss” “_und_” “_und_”

Is this easy possible with a function?

Thx – and Stay healthy! Stefan

This is much more difficult than one should think it should be. How to integrate with Lightroom so that it gets the new names depends on where you’re trying to use it, but in any case there’s the problem with identifying the characters that you want to target. Lua, the underlying language for Lightroom plugins, doesn’t understand Unicode, so it doesn’t understand that “ä” is one character. And even if it did, “ä” might not actually be one character… Unicode allows it to be expressed in two ways (as the single-character “ä”, and as the combination of “a” and a zero-width umlaut). It just makes everything a mess. You could probably use the LUA tag to get something that mostly seems to work, but it wouldn’t be guaranteed to work in all cases. —Jeffrey

— comment by Stefan Hamburg on April 3rd, 2020 at 1:24am JST (4 years ago) comment permalink

Hi,
Is there a way to re-validate the exported jpgs against the plugin’s understanding of the export? I have managed to delete some of my exported jpgs, but publisher doesn’t think anything needs to be re-published, so to avoid just re-publishing everything (3000+) images for each of the LR catalogs I have (10+) is there a way to detect just those that are missing?
Just to say I’ve been using the folder plugin for ages now and it’s great.
Regards,
Paul.

I assume that you’re talking about Folder Publisher or Collection Publisher…. and unfortunately, no, there’s not a way to do that, but it’s a good idea and I’ll give it some thought I just added it; update to the latest version, and you’ll find a new button in the section of the publish-service settings dialog where you set the target root folder. —Jeffrey

— comment by Paul on April 13th, 2020 at 7:19pm JST (4 years ago) comment permalink

Hello, and thank You for Your plug-ins. I installed Your Run Any Command but I am an absolute novice and in need of some help. How do I make LR to actually do something? I should do this: on export LR should add the exported images to a certain dumb collection. But I could not find any help concerning the actual commands how to do this? What are commands I use, what is the syntax? I do not not how to begin. As You see I have absolutely no experience in this but I realize that I could do much more with the plug-in.
Could You please help me a bit? Just give me a push:)

Yours

Väinö Louekari

Just leave the command stuff blank, and choose your target dumb collection from the dropdown near the bottom. —Jeffrey

— comment by Väinö Louekari on April 21st, 2020 at 9:14pm JST (4 years ago) comment permalink

Hi Jeffrey, hello from Montgomery Township, New Jersey, which is a rural town next to Princeton.

First the OS and Lightroom info:
* macOS Catalina 10.15.4
* Adobe Lightroom Classic CC 9.2.1
* “Metadata Wrangler” Export Filter 20200319.186

I’m having a problem that I can’t seem to resolve.

I export images using the “Metadata Wrangler” Lightroom Plugin to set the “Title” using the following template tags:

{Title?{Title}|}{CameraName?{CameraName}|}{LensInfo?{LensInfo}|} {ShutterSpeed?{ShutterSpeed}}

Everything looks great except for the shutter speed. The shutter speed displays as an HTML entity type fraction, for example, ¼ in the form field even before the image is exported. Is that the correct behaviour? Based on your description above, I would expect shutter speed to display as just 1/4 (that is 1 slash 4).

The reason I bring this up is that when I uploaded these images to WordPress, the images do not display correctly. When I remove the shutter speed,, the image uploads and displays successfully.

I have sent you the log via email.

Check Lightroom’s preferences, on the “Interface” tab, the “Use typographic fractions” option. If you turn that off, does it fix things? —Jeffrey

— comment by Khürt Louis Williams on May 3rd, 2020 at 12:56am JST (4 years ago) comment permalink

Hi Jeff,

In version 9.2.1 there is no “Use typographic fraction” on the “Interface” tab.
Image of the tab here:
https://drive.google.com/file/d/1QkRWZvaaZ70ZtxG_pvHMlPAqmhcWH_qZ/view.
Want to add any comments?

Cheers

Wow, I didn’t realized that the option is a MacOS-only option. I can’t imagine why that would be; I’ve reached out to Adobe to ask. —Jeffrey

— comment by Thales on May 3rd, 2020 at 9:15pm JST (4 years ago) comment permalink

Hello Jeff,

I’m writing you from Maricopa County, AZ, currently the capital of the pandemic Covid-19.
Hopefully, the internet tubes won’t carry the virus to your current location, wherever you are.

I made a mess of my LightRoom photos. That is easy to understand when the person is almost 80 years old.

I need a tool in LR that will allow me to filter files using the field from IPTC “Date Created”. The current filtering option does not have this option; it only has the “Date” field.

I found that other applications I used corrupted the metadata, rewriting the Date field with the date the Metadata was saved by the application. Fortunately, most files still have the correct date in the Create Date field when the image was captured; having that tool will help me a great deal.

I don’t know if a I could write the code I need to create that tool but, if you could help me with that, I will very much appreciate your assistance.

Well, That’s all for now. Keep safe.

Looking forward to reading your reply.

R.

If you’re speaking of the date within each master image file, you can copy the IPTC Date Created into the EXIF Date field via the ExifTool command-line program. The incantation would along the lines of “exiftool -'EXIF:CreateDatefiles“. However, even if you update the dates within the master image files, Lightroom will never see the update unless you remove and re-import the files. Even doing a metadata sync won’t get the new dates into Lightroom. )-: —Jeffery

— comment by Ricardo Valdes on July 10th, 2020 at 6:57am JST (3 years, 10 months ago) comment permalink

bit confused. Is it possible to geoencode AND put what3words into caption/keywords or whatever… whats the token. Im feeling very blond hehe

There’s no Template Token for what3words, because in order to compute it the plugin has to call out to their servers, and technical limitations with how Lightroom works makes this very difficult to handle as a token. That’s why it’s a separate process in the “Etc” tab. However, if you know that you’ve put the w3w code into a specific metadata field, you can then access that metadata field via a template token…. —Jeffrey

— comment by j murray on August 11th, 2020 at 1:00am JST (3 years, 9 months ago) comment permalink

I upgraded to LR10 and to your latest Plugin. I use in LR9 the Enhanced File Renaming option to change the folder tree from LR to my export folder so only the folder underneath the pictures will be exported (e.g. LR_Pictures/2020/2020-10-10 Munich/picture1.jpg -> 2020-10-10 Munich/picture1.jpg).
I use the parameter {FolderName}/{FILENAME} but the export creates the full structure. The preview of the result is correct.

What did I wrong?

What you describe sounds like something that would work in my Collection Publisher plugin, but would have never worked in my Folder Publisher plugin. (The whole point of Folder Publisher is to retain the file structure.) But if you’ve not made a mistake about which plugin, please send a plugin log, being sure to cite a specific example of exactly what you were expecting and what actually happened. —Jeffrey

— comment by Udo Neumann on October 22nd, 2020 at 4:26am JST (3 years, 6 months ago) comment permalink

Hi Jeffrey,
I’m writing from Fairfax, Virginia, located outside of Washington, DC. I’ve just started working with Metadata Wrangler and I’m really enjoying the capabilities of this plugin!

I’m using macOS Catalina version 10.15.7, Lightroom Classic release 10.0, and Metadata Wrangler version 20201017.189. I’ve got a couple of token formatting questions.

When using the {GPSCoordinates} token is there a way to limit the total number of digits? For example can the GPS location 37°56’43.9442″ N 23°38’39.9981″ E be shortened to 37°56’43.94″ N 23°38’39.99″ E?

Also, similar to the Khürt Williams question back on May 3, I’ve got the “Use typographic fractions” option turned off, but {ShutterSpeed} still exports as a typographic fraction. Any ideas?

The token {LUA=GPSCoordinates:gsub('(%.%d%d)%d+', '%1')} should give you the coordinates that you want. Lightroom doesn’t honor the “Use typographic fractions” option for plugin metadata requests, but I just added something to work around it: {ShutterSpeed:PF} should work (after upgrading your version of whatever plugin you’re using it in). —Jeffrey

— comment by Michael Liberman on November 2nd, 2020 at 8:08am JST (3 years, 6 months ago) comment permalink

Thank you so much, Jeffrey! That worked perfectly!!

— comment by Michael Liberman on November 9th, 2020 at 8:31am JST (3 years, 6 months ago) comment permalink

Hi Jeffrey,

(1) I’m using Template Token to rename files when exporting collections with your collection publisher – I found strange thing when using {HH} with some files :
{HH} and {T2} refer to the same hour of the day (ie 10) but with {ISO8601Date} the hour is different (ie 19).
In my case the {ISO8601Date} is correct – it shows the same time like LR. Might be correlated with timezones / time shifting

(2) how can I export {HH} and {ISO8601Date} to a txt file to check the differences? I used LUA code and “collect data for spreadsheet export” but after using “data explorer” with >1k files there seems a problem with the export buttons in the generated output window

Any ideas? THX

The way Lightroom handles dates is a royal mess. It could be a timezone issue (between the timezone where the photo was taken and what your computer is set to now), or it could be that you used Lightroom to update the time. Or just yet another Lightroom bug. You can try using my Geoencoding plugin to set the timezone for the relevant photos to see whether that fixes things. If it doesn’t perhaps export a few of the images to a stand-alone catalog and send it to me to test with? As for looking for photos that this happens to, using Data Explorer with “{LUA=ISO8601Date:sub(12,13)==HH}” should do it. —Jeffrey

— comment by Bernd on December 28th, 2020 at 8:42pm JST (3 years, 4 months ago) comment permalink

Hey All, trying to figure out if there is a token I can use to get the “Preserved File Name”? I want to write that data to the Headline field, but can’t seem to figure out how to make that token. Thank you.

I’m not familiar with that field; Lightroom doesn’t support it. If it’s included in the metadata of the original master image, or in an exported copy, you can conceivably use my Run Any Command plugin to invoke ExifTool to copy the data around where you want. —Jeffrey

— comment by Daniel L Osiedacz on December 29th, 2020 at 3:03am JST (3 years, 4 months ago) comment permalink

Feature Request

Hi Jeffery, I am using several plugins, to interoperate between Lightroom, WordPress and Alamy.
My goal is to link images presented in WordPress pages to Alamy selling pages.
The Fieldname produced by the LR Plugin Alamy Lightroom Bridge is called “Alamy URL”
I am using WP/LR Sync to publish from LR to WordPress. This Plugin understands the following list of custom fields: https://meowapps.com/wplr-sync-custom-fields/

Something that could fill the gap, would be, if your “write data filed” could read the Alamy URL and write it to any of the available fields

As per the PluginProperty token, I’d guess it’d be along the lines of {PluginProperty=com.jkeir.lightroom.alamyupload.url}, but you’ll have to ask the plugin author whether that last “url” part identifies the field you want, and change it if not. —Jeffrey

— comment by Georg Berg on February 7th, 2021 at 3:27am JST (3 years, 3 months ago) comment permalink

Is it possible to use these tokens in Lightroom’s built-in Metadata Presets?

No, my plugin’s tokens are mine. Adobe could choose to provide similar ones, but they choose to provide only what they choose to provide. —Jeffrey

— comment by Ronen on February 18th, 2021 at 5:31pm JST (3 years, 2 months ago) comment permalink

Hi Jeffrey.

I’m using your Folder publisher plugin and I’m trying to get it to include keywords to be included in the file name, up to a set maximum length, without breaking the maximum character limit in Windows. For some reason this doesn’t seem to work.

Here’s what I’ve put into the Enhanced File Renaming:
P{YYYY}{MM}{DD} {HH}.{MM}.{SS} ({Keywords:Length=100})

I know this topic has been posted before, but it still seems not to be working.
I’m using LR Classic CC version 7.2

Would be very greatful for any suggestion as to how I could do this.

I think I’ve fixed it. Either that, or made it worse. Due to poor design on my part more than a decade ago, the code in this area is just horrible, and really fragile. If I were to fix it and make it right, I might break things that people rely on, so I have to tread gingerly. —Jeffrey

— comment by Frans van Dal on February 26th, 2021 at 11:29pm JST (3 years, 2 months ago) comment permalink

I really love to use your plugins, almost every week I enhance my workflow with your tools. Respect for your excellent documentation and very stable software but I got stuck on the following. I tried many times but I just can’t figure out to use two functions at once for a single parsed value.
In a Headline field I use a format like: My Text intro – and this is de text to follow
I want to strip after the space next to the hyphen and set the first character of the first word (and…) in uppercase.
How do I use both {Headline:After=- } and {Headline:UCFirst} is this example?

Looks like a simple task but I just can’t find the correct answer neither a simular documented sample. I’m very curious what the method is and it would help the online knowlegde here.
Regards, Richard

Yeah, sorry, I made some boneheaded decisions a decade ago when I first created these things, and locked myself into this horrible token sublanguage. You can’t combine “After=” with “UCFirst”. )-: However, you can get around it with a LUA token: {LUA=return utf8.ucFirst(Headline:gsub('^.-%-%s*', ''))} —Jeffrey

— comment by Richard on March 8th, 2021 at 9:51am JST (3 years, 2 months ago) comment permalink

Is there a substring function? I accidentally named my files incorrectly.
Ex. PHOTO_12345 Should be PHOTO_22345. The “_1” should be “_2”. I was hoping to extract the “2345” portion and then just add a “2” when I renamed the file.

You can use the LUA token to access the power of the underlying language, e.g. “{LUA=Filename:gsub('PHOTO_1', 'PHOTO_2')}” —Jeffrey

— comment by Dan on April 5th, 2021 at 10:47am JST (3 years ago) comment permalink

Hello Jeffrey,

Thanks again for this plugin 🙂
I have a question, I have been using the {People} template for “People Shown” IPTC Field. But the suggestion is to use “,” between name in this field. So instead “Anna Fredrick and John Fredrick”, “Anna Fredrive, John Fredrick”. Is it possible modify the the “and” into “,”?

Thank you!

That makes sense. I’ve added a “separated by” bit to the code, so it’ll get rolled out with each plugin during its next update. You’ll want to use {People=;separated by ", "} —Jeffrey

— comment by Roger on April 14th, 2021 at 2:39am JST (3 years ago) comment permalink

Thank you Jeffrey! I appreciate your help! 🙂

— comment by Roger on April 14th, 2021 at 7:37pm JST (3 years ago) comment permalink

I have some LR keywords containing capital word OFF, it might be JimOFF etc. meaning those photos will not end up in certain exports if I choose to add that rule in LR (not containing OFF). Now with this plugin I would like to add a special keyword to exported photos, a “noOFF” for those pics not having the OFF anywhere in the LR keywords. This way I would be able to filter photos in a synced iPhone etc. so that no “OFF” photos show up by searching for “nooff” in the iPhone.

I did not find a way to add a keyword with a rule “contains” like *OFF in the plugin. I tried {IfKeyword=*OFF;OFF;noOFF} but that did not do the trick, every photo got the “noOFF” and also the one with the original LR keyword JimOFF.

Is there a way to do this? BTW I am already very happy with the ability to add ratings to keywords for the same purpose, for a synced iPhone.

I assume you’re speaking of the “Snapshot on Export” plugin, and its abilityt o add a keyword. Unfortunately, there’s no way to make the keyword-addition dynamic based on other aspects of the photo, sorry. —Jeffrey

— comment by Benz on May 3rd, 2021 at 1:11am JST (3 years ago) comment permalink

Regarding my keyword “OFF” issue. I am using the Metadata Wrangler plugin which I just found when I was wondering how to add rating keywords for LR Published Services exports for Photos app for iPhone synchronization (as iTunes Folder Sync is very unreliable). Photos sync in iTunes seems to work better. So I am very happy I can add “5star” and “4star” etc. keywords at the export automatically from my ratings.

But I also have keywords in LR ending with the word OFF. Let’s say I have a coworker who mostly is in pictures regarding work and I mostly present photos at work. Some photos are from vacations and I have given those an extra keyword “JimOFF” so that I can have exports with only work related photos (in LR Smart Folder “does not contain OFF”). Now for Photos and iPhone I would like all my pics to have either yesOFF on noOFF keyword. Then I can search on my iPhone for photos “noOFF” and only work photos would show. Or vice versa, searching for lets say “yesOFF” would let me share fun moments out of work.

So, can the IfKeyword have a “contains” or “does not contain” option so that I could make it search for etc. “JimOFF” and then an extra keyword like “yesOFF” would be written in the exported photo and if no “OFF” word is found then “noOFF” would be the written keyword.

— comment by Benz on May 4th, 2021 at 7:19am JST (3 years ago) comment permalink

One more thing, sure, I can search on my iPhone for “OFF” keywords already. But as the other photos don’t have “noOFF” keyword I cannot search for those. Either I find the “OFF” photos or all including also the OFF photos. I want to find the the ones without the OFF. That is where I need to be able to add the “noOFF” keyword.

You can use the special LUA token for this:

{LUA= for kw in pairs(KW) do if kw:match('OFF') then return 'YesOFF' end end return 'NoOFF'}

If the photo has any keyword with the three-letter sequence “OFF” in it, this becomes “YesOFF”. Otherwise, it becomes “NoOFF”. —Jeffrey

— comment by Benz on May 4th, 2021 at 7:24am JST (3 years ago) comment permalink

I am trying to set up your export to tweet plugin.

I am entering the following into the token space ‘{Title|Filename}, Shot at {Keywords:DescendantOf=.places}, {YYYY}.{Keywords:NS=#%s}’

intending the keywords to come out as hashtags. However I have only been able to get either spaces removed from the keywords, or a # added before the keyword. I can’t work out how to get both working together. Also I can’t work out how to remove the commas between each keyword (if that is indeed possible).

Could you tell me what I am doing wrong please? This sort of thing is not my forte lol.

Thanks

Lisa

Officially the “=#%s” thing doesn’t work with filters such as “:NS” (because the code was designed poorly early on, and grew into a horrendous patchwork of kuldge), but I just added another patch that should get it working in this case. Currently it’s not possible to change the commas inserted between each keyword. —Jeffrey

— comment by Lisa Myring on June 7th, 2021 at 9:00pm JST (2 years, 11 months 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.

IMPORTANT:I'm mostly retired, so I don't check comments often anymore, sorry.


You can use basic HTML; be sure to close tags properly.

Subscribe without commenting