{"id":799,"date":"2008-04-22T16:32:56","date_gmt":"2008-04-22T07:32:56","guid":{"rendered":"https:\/\/regex.info\/blog\/lightroom-goodies\/template"},"modified":"2017-12-07T07:24:36","modified_gmt":"2017-12-06T22:24:36","slug":"template","status":"publish","type":"page","link":"https:\/\/regex.info\/blog\/lightroom-goodies\/template","title":{"rendered":"Preset <i>Template Tokens<\/i> in My Lightroom Plugins"},"content":{"rendered":"\n\n<style type=\"text\/css\">\n.token { font-family: courier; color: #CC0; white-space:nowrap }\ntable.t { border-collapse: collapse }\ntable.t td { border: solid 1px #333 }\ntable.t td:first-child { font-family: courier; padding: 0 1em; color: #CC0 }\ntable.t td:last-child  { padding-left: 1em }\ntable.t td[colspan=\"2\"] {  border: none ; padding-top: 40px; padding-bottom:10px; font-family: times; color: #EEE }\ntable.t tr { vertical-align: baseline }\n<\/style>\n\n<div style='padding:20px; float:right; margin-bottom:20px; margin-left:2em; border: solid 1px red'>\n<ul style='padding:0; margin:0'>\n<li><a class='quiet' href='\/blog\/lightroom-goodies'>Jeffrey's Lightroom Goodies<\/a><\/li>\n<li><a class='quiet' href='\/blog\/'>Jeffrey's Blog<\/a><\/li>\n<\/ul>\n<\/div>\n\n\n<p>Many of <a href='\/blog\/lightroom-goodies\/'>my plugins for Adobe Lightroom Classic<\/a> offer the ability to\nconstruct certain kinds of data dynamically, such as setting image titles when uploading photos to <span class='nobr'>a\nremote<\/span> site.<\/p>\n\n<p>The rest of this page documents the template notation as it exists for\nthe <span style='color:#F44'>latest versions<\/span> of the plugins running\nin the latest version of Lightroom. <span class='nobr'>If something<\/span>\ndoesn't seem to work as documented, please make sure you're using the\nlatest version of your plugin, via the <span class='QO'>&#8220;<\/span>check now<span class='QC'>&#8221;<\/span> button in the\nupper-right section of the Plugin Manager.<\/p>\n\n<hr width='40%' align='left'\/>\n\n<p>A <i>template<\/i> is <span class='nobr'>a combination<\/span> of prose and special tokens wrapped in <tt><b>{<\/b><\/tt> ... <tt><b>}<\/b><\/tt> that insert photo-specific items.<\/p>\n\n<p>For example, the template<\/p>\n<pre>\n     Copyright {YYYY} {Artist}\n<\/pre>\n\n<p>includes the text <span class='QO'>&#8220;<\/span>Copyright<span class='QC'>&#8221;<\/span>, <span class='nobr'>a space,<\/span> the token <span class='token'>YYYY<\/span> (which stands for\nthe year that the photo was taken), <span class='nobr'>a space,<\/span> and the <span class='token'>Artist<\/span> token (which\nstands for the value of the <span class='QO'>&#8220;<\/span>Artist<span class='QC'>&#8221;<\/span> metadata item).<\/p>\n\n<p>For one of my photos taken in 2006, this example would become<\/p>\n<pre>\n   <b>Copyright 2006 Jeffrey Eric Francis Friedl<\/b>\n<\/pre>\n\n<p style='margin-top:20px'>Here is the list of tokens that are currently supported:<\/p>\n\n<table class='t' style='margin-left:1em' border='0' cellpadding='5' cellspacing='0'>\n\n<tr><td class='th' colspan='2'>Photo Date<\/td><\/tr>\n\n\n<tr id='YYYY'><td> YYYY <\/td>  <td>The year the photo was taken, as <span class='nobr'>a four<\/span>-digit string<\/td><\/tr>\n<tr id='YY'><td> YY <\/td>      <td>The year the photo was taken, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='MM'><td> MM <\/td>      <td>The month the photo was taken, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='DD'><td> DD <\/td>      <td>The day of the month the photo was taken, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='HH'><td> HH <\/td>      <td>The hour value for the time the photo was taken, in 24-hour notation, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='HH12'><td> HH12 <\/td>  <td>The hour value for the time the photo was taken, in 12-hour notation, as one- or two-digit string<\/td><\/tr>\n<tr id='AMPM'><td> AMPM <\/td>  <td>The AM\/PM designation for the time when the photo was taken<\/td><\/tr>\n<tr id='MIN'><td> MIN <\/td>    <td>The minute value for the time the photo was taken, as <span class='nobr'>a two-digit<\/span> string<\/td><\/tr>\n<tr id='SS'><td> SS <\/td>      <td>The seconds value for the time the photo was taken, as <span class='nobr'>a two-digit<\/span> string<\/td><\/tr>\n\n<tr id='SST1'><td> SST1 <\/td>  <td>The sub-second value for the time the photo was taken, as <span class='nobr'>a single<\/span>-digit number of tenths of <span class='nobr'>a second.<\/span> <span class='nobr'>If the photo<\/span> time was not captured to detail beyond integral seconds, the value is <span class='QO'>&#8220;<\/span><tt>0<\/tt><span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='SST2'><td> SST2 <\/td>  <td>The sub-second value for the time the photo was taken, as <span class='nobr'>a two<\/span>-digit number of hundredths of <span class='nobr'>a second.<\/span> <span class='nobr'>If the photo<\/span> time is not available to detail beyond integral seconds, the value is <span class='QO'>&#8220;<\/span><tt>00<\/tt><span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='SST3'><td> SST3 <\/td>  <td>The sub-second value for the time the photo was taken, as <span class='nobr'>a three<\/span>-digit number of thousandths of <span class='nobr'>a second.<\/span> <span class='nobr'>If the photo<\/span> time is not available to detail beyond integral seconds, the value is <span class='QO'>&#8220;<\/span><tt>000<\/tt><span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n\n<tr id='Weekday'><td> Weekday <\/td>    <td>Localized day of the week that the photo was taken (e.g. <span class='QO'>&#8220;<\/span>Wednesday<span class='QC'>&#8221;<\/span>).<\/td><\/tr>\n<tr id='Wday'><td> Wday <\/td>      <td>Localized short form (usually three-character string) of the day of the week that the photo was taken (e.g. <span class='QO'>&#8220;<\/span>Wed<span class='QC'>&#8221;<\/span>).<\/td><\/tr>\n\n\n<tr id='Mon'><td> Mon <\/td>    <td>The month the photo was taken, as <span class='nobr'>a localized<\/span> three-character string<\/td><\/tr>\n<tr id='Month'><td> Month <\/td><td>The month the photo was taken, as <span class='nobr'>a localized<\/span> string<\/td><\/tr>\n<tr id='Date'><td> Date <\/td>  <td>The day of the month the photo was taken, as one- or two-digit string<\/td><\/tr>\n\n<tr id='DAYNUM'><td> DAYNUM <\/td>   <td>The ISO-8601 <span class='QO'>&#8220;<\/span>day of the year<span class='QC'>&#8221;<\/span> that the photo was taken on, as <span class='nobr'>a three<\/span>-digit string.<\/td><\/tr>\n<tr id='WEEKNUM'><td> WEEKNUM <\/td> <td>The ISO-8601 <span class='QO'>&#8220;<\/span>week of the year<span class='QC'>&#8221;<\/span> that the photo was taken on, as <span class='nobr'>a two<\/span>-digit string.<\/td><\/tr>\n\n<tr id='ISO8601Date'>          <td> ISO8601Date <\/td> <td>The <a href='https:\/\/en.wikipedia.org\/wiki\/ISO_8601#Combined_date_and_time_representations'>ISO 8601<\/a> date\/time string of the photo. Unlike other date-related fields, this may include <span class='nobr'>a timezone<\/span> indication, and\/or <span class='nobr'>a sub<\/span>-second timestamp.<\/td><\/tr>\n\n\n<tr id='D1'><td> D1 <\/td>    <td>The full date of the photo, in the system-localized short format that you can set in\n                                 your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                 along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>2010-03-24<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='D2'><td> D2 <\/td>               <td>The full date of the photo, in the system-localized medium format that you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>Mar 24, 2010<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='D3'><td> D3 <\/td>               <td>The full date of the photo, in the system-localized long format that you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span><span class='nobr'>March 24,<\/span> 2010<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='T1'><td> T1 <\/td>               <td>The full time-of-day of the photo, in the system-localized short format that you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>3:38 PM<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='T2'><td> T2 <\/td>               <td>The full time-of-day of  the photo, in the system-localized long format that you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>3:38:02 PM<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr><td id='PhotoDaysSince'> PhotoDaysSince=<i>date<\/i><\/td>\n\n<td>The number of days from the given date and the date of the photo. This is intended for use along the lines of\n\n    <span class='nobr'><span class='QO'>&#8220;<\/span><b class='token'><tt>My 2010 In Photos: Day {PhotoDaysSince=2009-12-31}<\/tt><\/b><span class='QC'>&#8221;<\/span><\/span>\n\n<p>The <i>date<\/i> argument is in the form <span class='QO'>&#8220;<\/span><b><tt>YYYY-MM-DD<\/tt><\/b><span class='QC'>&#8221;<\/span> but may also have an appended time, in\n<b><tt>HH:MM<\/tt><\/b> 24-hour notation, to delimit when dates start. If you're <span class='nobr'>a night<\/span>-owl who might\nwant to include <span class='nobr'>a photo<\/span> taken late in the evening, after midnight, as being part of the previous day,\nyou might want to use something like\n\n   <span class='nobr'><span class='QO'>&#8220;<\/span><b class='token'><tt>My 2010 In Photos: Day {PhotoDaysSince=2009-12-31 04:00}<\/tt><\/b><span class='QC'>&#8221;<\/span><\/span>\n\nto have photo taken until 4am be considered part of the previous day.<\/p>\n\n<p>One concern to watch out for with this date\/time example is that photos taken during the first four hours of Jan 1\n2010 would appear to still be part of the previous day, day <span class='QO'>&#8220;<\/span><b><tt>0<\/tt><\/b><span class='QC'>&#8221;<\/span>.<\/p>\n\n<\/td><\/tr>\n\n<tr id='PhotoDaysUntil'><td> PhotoDaysUntil=<i>date<\/i><\/td> <td>Like <span class='token'>PhotoDaysSince<\/span>, but in the counting-down-until sense.<\/td><\/tr>\n\n<tr id='IptcDateCreated'><td> IptcDateCreated <\/td>             <td>The IPTC <span class='QO'>&#8220;<\/span>Date Created<span class='QC'>&#8221;<\/span> field.<\/tr>\n\n<tr><td colspan='2'>Current Date<\/td><\/tr>\n\n\n<tr id='yyyy'><td> yyyy <\/td>             <td>The current year as <span class='nobr'>a four<\/span>-digit string<\/td><\/tr>\n<tr id='yy'><td> yy <\/td>               <td>The current year as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='mm'><td> mm <\/td>               <td>The current month as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='dd'><td> dd <\/td>               <td>The current day of the month as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='hh'><td> hh <\/td>               <td>The current hour value, in 24-hour format, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='hh12'><td> hh12 <\/td>             <td>The current hour value, in 12-hour format, as <span class='nobr'>a one<\/span>- or two-digit string<\/td><\/tr>\n<tr id='ampm'><td> ampm <\/td>             <td>The current time's AM\/PM designation<\/td><\/tr>\n<tr id='min'><td> min <\/td>              <td>The current minute value, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='ss'><td> ss <\/td>               <td>The current seconds value, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n\n\n\n<tr id='weekday'><td> weekday <\/td>      <td>The current day of the week, as <span class='nobr'>a localized<\/span> string, e.g. <span class='QO'>&#8220;<\/span>Wednesday<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='wday'><td> wday <\/td>            <td>The current day of the week, as short-form (usually three-character) localized string, e.g. <span class='QO'>&#8220;<\/span>Wed<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n\n<tr id='mon'><td> mon <\/td>              <td>The current month, as <span class='nobr'>a localized<\/span> three-character string<\/td><\/tr>\n<tr id='month'><td> month <\/td>            <td>The current month, as <span class='nobr'>a localized<\/span> string<\/td><\/tr>\n<tr id='date'><td> date <\/td>             <td>The current day of the month, as one- or two-digit string<\/td><\/tr>\n\n\n<tr id='daynum'><td> daynum <\/td>   <td>The current ISO-8601 <span class='QO'>&#8220;<\/span>day of the year<span class='QC'>&#8221;<\/span>, as <span class='nobr'>a three<\/span>-digit string.<\/td><\/tr>\n<tr id='weeknum'><td> weeknum <\/td> <td>The current ISO-8601 <span class='QO'>&#8220;<\/span>week of the year<span class='QC'>&#8221;<\/span>, as <span class='nobr'>a two<\/span>-digit string.<\/td><\/tr>\n\n<tr id='d1'><td> d1 <\/td>               <td>The current full date, in the system-localized short format that\n                                    you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>2010-03-23<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='d2'><td> d2 <\/td>               <td>The current full date, in the system-localized medium format that\n                                    you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>Mar 23, 2010<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='d3'><td> d3 <\/td>               <td>The current full date, in the system-localized long format that\n                                    you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span><span class='nobr'>March 23,<\/span> 2010<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='t1'><td> t1 <\/td>               <td>The current full time-of-day, in the system-localized short format\n                                    that you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>3:38 PM<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n<tr id='t2'><td> t2 <\/td>               <td>The current full time-of-day, in the system-localized long format\n                                    that you can set in\n                                    your operating system's preferences dialog. <span class='nobr'>On my system<\/span> this is something\n                                    along the <span class='nobr'>lines of <span class='QO'>&#8220;<\/span>3:38:02 PM<span class='QC'>&#8221;<\/span>.<\/span><\/td><\/tr>\n\n\n\n<tr id='DaysSince'><td> DaysSince=<i>date<\/i><\/td> <td>Like <span class='token'>PhotoDaysSince<\/span>, but measures\nthe current date to the date (or date\/time) given in the argument, without regard to any photo date. <span class='nobr'>You might<\/span> want to use\nthis along with something like\n\n<span class='nobr'><span class='QO'>&#8220;<\/span><b class='token'><tt>My 2010 In Photos: Day {DaysSince=2009-12-31}<\/tt><\/b><span class='QC'>&#8221;<\/span><\/span>\n\nif 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\nto use the date\/time form if you're <span class='nobr'>a night<\/span> owl and want an upload done late in the evening, after midnight, to be considered as having been done the previous day. <\/td><\/tr>\n\n<tr id='DaysUntil'><td> DaysUntil=<i>date<\/i><\/td> <td>Like <span class='token'>PhotoDaysUntil<\/span>, but in the counting-down-until sense.<\/td><\/tr>\n\n<tr id='filedates'><td colspan='2'>Master File Filesystem Dates\n<br\/><small>These are available only if the master image file is currently available.<\/small><\/td><\/tr>\n\n<tr id='FileYYYY'><td> FileYYYY <\/td>      <td>File creation year, as <span class='nobr'>a four<\/span>-digit string<\/td><\/tr>\n<tr id='FileYY'><td> FileYY <\/td>          <td>File creation year, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileMM'><td> FileMM <\/td>          <td>File creation month, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileDD'><td> FileDD <\/td>          <td>File creation day of the month, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileHH'><td> FileHH <\/td>          <td>File creation hour value, in 24-hour notation, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileMIN'><td> FileMIN <\/td>        <td>File creation minute value, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileSS'><td> FileSS <\/td>          <td>File creation seconds value, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n\n<tr><td colspan='2'><\/td><\/tr>\n<tr id='FileModYYYY'><td> FileModYYYY <\/td>      <td>File modification year, as <span class='nobr'>a four<\/span>-digit string<\/td><\/tr>\n<tr id='FileModYY'><td> FileModYY <\/td>          <td>File modification year, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileModMM'><td> FileModMM <\/td>          <td>File modification month, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileModDD'><td> FileModDD <\/td>          <td>File modification day of the month, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileModHH'><td> FileModHH <\/td>          <td>File modification hour value, in 24-hour notation, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileModMIN'><td> FileModMIN <\/td>        <td>File modification minute value, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n<tr id='FileModSS'><td> FileModSS <\/td>          <td>File modification seconds value, as <span class='nobr'>a two<\/span>-digit string<\/td><\/tr>\n\n\n<tr><td colspan='2'>Filenames, Paths, and Catalog Organization<\/td><\/tr>\n\n<tr id='FullExportedFile'><td> FullExportedFile <\/td> <td>When an Export or Publish operation is ongoing, the full path and filename of the exported copy<\/td><\/tr>\n\n<tr id='FullExportedFolder'><td> FullExportedFolder <\/td><td>When an Export or Publish operation is ongoing, the full path to the folder of the exported copy<\/td><\/tr>\n\n<tr id='Filename'><td> Filename <\/td>         <td>When an Export or Publish operation is ongoing, the filename &ndash; without path and without extension &ndash; of the exported copy<\/td><\/tr>\n\n<tr id='FILENAME'><td> FILENAME <\/td>         <td>Like <span class='token'>Filename<\/span>, but includes the extension<\/td><\/tr>\n\n<tr id='FilenameNumber'><td> FilenameNumber <\/td> <td><p>The numeric part of the Filename, e.g. with <span class='QO'>&#8220;<\/span>IMG_1234.jpg<span class='QC'>&#8221;<\/span>, <span class='token'>{FilenameNumber}<\/span> is <span class='QO'>&#8220;<\/span>1234<span class='QC'>&#8221;<\/span>.<\/p>\n\n<p>If the filename contains multiple sequences of digits, such as with <span class='QO'>&#8220;<\/span>BODY2_FRAME1234.JPG<span class='QC'>&#8221;<\/span> &mdash; which has <span class='QO'>&#8220;<\/span>2<span class='QC'>&#8221;<\/span> and <span class='QO'>&#8220;<\/span>1234<span class='QC'>&#8221;<\/span> &mdash; the longest sequence is used (<span class='QO'>&#8220;<\/span>1234<span class='QC'>&#8221;<\/span> in this example). <span class='nobr'>If more than<\/span> one sequence are equally long, the rightmost sequence is used, so with <span class='QO'>&#8220;<\/span>BODY2_FRAME1.JPG<span class='QC'>&#8221;<\/span> the result is <span class='QO'>&#8220;<\/span>1<span class='QC'>&#8221;<\/span>.<\/p>\n\n<p>Without an argument, <span class='token'>{FilenameNumber}<\/span> returns exactly that string of digits. However, if you add an argument like <span class='token'>{FilenameNumber=####}<\/span> then the result is padded with zeros (or leading zeros are truncated) as needed to make the length match the number of <span class='QO'>&#8220;<\/span>#<span class='QC'>&#8221;<\/span> in the argument. Some examples:<\/p>\n\n<style type=\"text\/css\">\ntable#FilenameNumberTable td:nth-child(3) { text-align:right}\n<\/style>\n\n<table border='1' cellspacing='0' cellpadding='5' id='FilenameNumberTable'><tr><th>Filename<\/th><th>Token<\/th><th>Result<\/th><\/tr>\n\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber}<\/span><\/td><td>000123<\/td><\/tr>\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber=#}<\/span><\/td><td>123<\/td><\/tr>\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber=##}<\/span><\/td><td>123<\/td><\/tr>\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber=###}<\/span><\/td><td>123<\/td><\/tr>\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber=####}<\/span><\/td><td>0123<\/td><\/tr>\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber=#####}<\/span><\/td><td>00123<\/td><\/tr>\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber=######}<\/span><\/td><td>000123<\/td><\/tr>\n<tr><td>IMG_00123.jpg<\/td><td><span class='token'>{FilenameNumber=#######}<\/span><\/td><td>0000123<\/td><\/tr>\n<\/table>\n\n<\/td><\/tr>\n\n\n<tr id='FullMasterFile'><td> FullMasterFile <\/td> <td>The full path and filename of the master image on disk <\/td><\/tr>\n<tr id='LibraryFilename'><td> LibraryFilename <\/td>  <td>The filename &ndash; without path and without extension &ndash; of the master file in the library (which is not necessarily the filename being generated for the exported copy)<\/td><\/tr>\n<tr id='LIBRARYFILENAME'><td> LIBRARYFILENAME <\/td>  <td>Like <span class='token'>LibraryFilename<\/span>, but includes the extension<\/td><\/tr>\n\n<tr id='FolderPath'><td> FolderPath <\/td>       <td>The full path of the folder in which the master image in the catalog resides<\/td><\/tr>\n\n<tr id='RelativeFolder'><td> RelativeFolder <\/td>    <td>The part of the full path to the master image that appears in Library's <span class='QO'>&#8220;<\/span>Folder<span class='QC'>&#8221;<\/span> panel. This differs from\n<span class='token'>FolderPath<\/span> in that it omits the leading part of the full path that leads to the lowest-level folder shown within the Folder Panel.\n\n<\/td><\/tr>\n\n\n<tr id='FolderName'><td> FolderName <\/td>       <td>\n\n  <p>The name of the folder (without path) in which the master image in the catalog resides.<\/p>\n\n  <p>You can also pluck folder names from the hierarchy that the image lies in by counting down from the end:<\/p>\n\n  <p style='margin-left:1em'><span class='token'>{FolderName=-1}<\/span> is the parent folder that <span class='token'>{FolderName}<\/span> is in.\n  <br\/><span class='token'>{FolderName=-2}<\/span> is the parent of the parent of <span class='token'>{FolderName}<\/span>.\n  <br\/><span class='token'>{FolderName=-3}<\/span> is its parent, etc., until you pass the base folder shown in Library, after which the token becomes blank.\n  <br\/><small><br\/>(For completeness, <span class='token'>{FolderName=-0}<\/span> is the same as <span class='token'>{FolderName}<\/span>)<\/small>\n  <\/p>\n\n  <p>You can also count up from the root folder shown in the Library <span class='QO'>&#8220;<\/span>Folders<span class='QC'>&#8221;<\/span> panel:<\/p>\n\n  <p style='margin-left:1em'><span class='token'>{FolderName=+0}<\/span> is the name of the most-root folder for the image.\n  <br\/><span class='token'>{FolderName=+1}<\/span> is the next successor that leads to the image.\n  <br\/><span class='token'>{FolderName=+2}<\/span> is the next successor after that, etc., until you get beyond <span class='token'>{FolderName}<\/span>, after which the token becomes blank.<\/p>\n\n  <p>As a concrete example, consider this folder hierarchy shown in Lightroom:<\/p>\n   <img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/FolderTokenExmple.png\" width=\"350\" height=\"220\"\nclass=\"raw\"\nid=\"iFolderTokenExmple\"\nstyle=\"margin-left:1em\"\/>\n  <p>The following examples are for an image in the deepest level (in the <span class='QO'>&#8220;<\/span>Nanzen Temple<span class='QC'>&#8221;<\/span> folder):<\/p>\n\n  <table cellspacing='0' cellpadding='3'><tr><td><\/td><td>Result<\/td><\/tr>\n<tr><td><span class='token'>{FolderName}<\/span><\/td><td> Nanzen Temple &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-0}<\/span><\/td><td> Nanzen Temple <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-1}<\/span><\/td><td> Temples <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-2}<\/span><\/td><td> Kyoto <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-3}<\/span><\/td><td> Japan <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-4}<\/span><\/td><td> Asia <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-5}<\/span><\/td><td> Travel <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-6}<\/span><\/td><td> MyPhotoLibrary <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-7}<\/span><\/td><td> <i><small>blank<\/small><\/i> <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=-8}<\/span><\/td><td> <i><small>blank<\/small><\/i> <\/td><\/tr>\n\n<tr><td><span class='token'>{FolderName=+0}<\/span><\/td><td> MyPhotoLibrary <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+1}<\/span><\/td><td> Travel <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+2}<\/span><\/td><td> Asia <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+3}<\/span><\/td><td> Japan <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+4}<\/span><\/td><td> Kyoto <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+5}<\/span><\/td><td> Temples <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+6}<\/span><\/td><td> Nanzen Temple <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+7}<\/span><\/td><td> <i><small>blank<\/small><\/i> <\/td><\/tr>\n<tr><td><span class='token'>{FolderName=+8}<\/span><\/td><td> <i><small>blank<\/small><\/i> <\/td><\/tr>\n\n  <\/table>\n\n<p>You can leave off the <span class='token'>+<\/span> if you like, so you can refer to the\nroot folder as\n<span class='token'>{FolderName=0}<\/span> or\n<span class='token'>{FolderName=+0}<\/span>.<\/p>\n\n<\/td><\/tr>\n\n\n<tr id='CollectionNames'><td> CollectionNames <\/td>\n<td>\n<p>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/collections-monuments-paris.png\" width=\"220\" height=\"208\"\nclass=\"raw\"\nid=\"icollections_monuments_paris\"\nstyle=\"float:right; margin-left:2em\"\/>\n\n<span class='nobr'>A comma<\/span>-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.)<\/p>\n\n<p>As an example, a photo of the Eiffel Tower included within the two highlighted collections seen in the screenshot at right\nproduces <span class='nobr'><span class='QO'>&#8220;<\/span>Monuments, Paris<span class='QC'>&#8221;<\/span>.<\/span><\/p>\n\n<p>You can use <span class='nobr'>a special<\/span> form where you can dress up each collection name:\nwith our example, <span class='token nobr'>{CollectionNames=&#34;%s&#34;}<\/span> results in:<\/p>\n<center>&#34;Monuments&#34;, &#34;Paris&#34;<\/center>\n\n<p><span class='nobr'>In this special<\/span> form, the text after\nthe equal sign is used, with the <span class='QO'>&#8220;<\/span><tt>%s<\/tt><span class='QC'>&#8221;<\/span> marking where the name itself should be placed. <span class='nobr'>In the example<\/span>, that text is<\/p>\n\n<center><tt>&#34;%s&#34;<\/tt><\/center>\n\n<p>so each keyword gets wrapped in double quotes.<\/p>\n\n\n\n<p>Also see <a href='#CN'>the <b>CN<\/b> table<\/a> and <a href='#CNf'>the <b>CNf<\/b> function<\/a>,\n available to <a href='#lua'>the special <span class='token'>{LUA}<\/span> token<\/a>.<\/p>\n\n<\/td><\/tr>\n\n\n<tr id='CollectionFullNames'><td> CollectionFullNames <\/td>\n<td>\n<p>\nLike <span class='token'>{CollectionNames}<\/span> above, but each name is the full hierarchical name of the collection,\nsuch as <span class='nobr'><span class='QO'>&#8220;<\/span>Travel &gt; France &gt; Paris<span class='QC'>&#8221;<\/span><\/span>\nfor the <span class='QO'>&#8220;<\/span>Paris<span class='QC'>&#8221;<\/span> collection.<\/p>\n\n<p>Therefore, our sample Eiffel Tower photo in the screenshot above produces\n\n<span class='nobr'><span class='QO'>&#8220;<\/span>Monuments, Travel &gt; France &gt; Paris<span class='QC'>&#8221;<\/span>.<\/span><\/p>\n\n<p>The special form mentioned with <span class='token'>CollectionNames<\/span> above also works here.<\/p>\n\n<p>Also see <a href='#CFN'>the <b>CFN<\/b> table<\/a> and <a href='#CFNf'>the <b>CFNf<\/b> function<\/a>,\n available to <a href='#lua'>the special <span class='token'>{LUA}<\/span> token<\/a>.<\/p>\n\n\n<\/td><\/tr>\n\n\n\n\n\n\n<tr><td colspan='2'>Image<\/td><\/tr>\n\n\n<tr id='Filetype'><td> Filetype <\/td>            <td>One of: <span class='QO'>&#8220;<\/span>JPEG<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>RAW<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>DNG<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>TIFF<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>PSD<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>DNG<span class='QC'>&#8221;<\/span>, or <span class='QO'>&#8220;<\/span>Video<span class='QC'>&#8221;<\/span><\/td><\/tr>\n<tr id='OriginalWidth'><td> OriginalWidth <\/td>       <td>The width of the (possibly pre-crop) <b>original master image<\/b> (not the exported one), in pixels<\/td><\/tr>\n<tr id='OriginalHeight'><td> OriginalHeight <\/td>      <td>The height of the (possibly pre-crop) <b>original master image<\/b> (not the exported one), in pixels<\/td><\/tr>\n<tr id='Cropped'><td> Cropped <\/td>             <td>Either <span class='QO'>&#8220;<\/span>cropped<span class='QC'>&#8221;<\/span> or <span class='QO'>&#8220;<\/span>uncropped<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='CroppedWidth'><td> CroppedWidth <\/td>        <td>The width of the (possibly post-crop) <b>library image<\/b> (not the exported one), in pixels<\/td><\/tr>\n<tr id='CroppedHeight'><td> CroppedHeight <\/td>       <td>The height of the (possibly post-crop) <b>library image<\/b> (not the exported one), in pixels<\/td><\/tr>\n<tr id='AspectRatio'><td> AspectRatio <\/td>         <td>This becomes <span class='QO'>&#8220;<\/span>Portrait<span class='QC'>&#8221;<\/span> if the cropped image is more tall than wide,  <span class='QO'>&#8220;<\/span>Square<span class='QC'>&#8221;<\/span> if the cropped with and height are the same, and  <span class='QO'>&#8220;<\/span>Landscape<span class='QC'>&#8221;<\/span> if wider than tall. <span class='nobr'>You can substitute<\/span> your own phrases for each by using the form\n<span class='token'>{AspectRatio=<i>X<\/i>,<i>Y<\/i>,<i>Z<\/i>}<\/span>, where <i>X<\/i>, <i>Y<\/i>, and <i>Z<\/i> are used for <i>Portrait<\/i>, <i>Square<\/i>, and <i>Landscape<\/i>, respectively.\n\n<\/td><\/tr>\n\n\n<tr><td colspan='2'>Lens \/ Camera \/ Exposure<\/td><\/tr>\n\n\n\n<tr id='Aperture'><td> Aperture <\/td>            <td>The photo's aperture value, formatted like <span class='QO'>&#8220;<\/span>f\/4.5<span class='QC'>&#8221;<\/span><\/td><\/tr>\n<tr id='ApertureNum'><td> ApertureNum <\/td>         <td>The photo's aperture value, as <span class='nobr'>a raw<\/span> number<\/td><\/tr>\n<tr id='CameraMake'><td> CameraMake <\/td>          <td>The photo's <span class='QO'>&#8220;<\/span>Make<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CameraModel'><td> CameraModel <\/td>         <td>The photo's <span class='QO'>&#8220;<\/span>Model<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CameraName'><td> CameraName <\/td>          <td>The <b>Make<\/b> and <b>Model<\/b> combined in <span class='nobr'>a way<\/span> that is natural to <span class='nobr'>a reader.<\/span> For example, if <b>Make<\/b> is <span class='QO'>&#8220;<\/span>EASTMAN KODAK COMPANY<span class='QC'>&#8221;<\/span> and <b>Model<\/b> is <span class='QO'>&#8220;<\/span>KODAK XYZ123 ZOOM DIGITAL CAMERA<span class='QC'>&#8221;<\/span>, <span class='token'>CameraName<\/span> is <span class='QO'>&#8220;<\/span>Kodak XYZ123 Zoom<span class='QC'>&#8221;<\/span>. <span class='nobr'>I have a<\/span> lot of camera-specific rules about how to combine the make and model sensibly, so if you find one for which <span class='nobr'>I don't<\/span> do <span class='nobr'>a good<\/span> job, please send me <span class='nobr'>a sample<\/span> image so that <span class='nobr'>I can<\/span> inspect its metadata.<\/td><\/tr>\n<tr id='CameraSerialNumber'><td> CameraSerialNumber <\/td>  <td>The photo's <span class='QO'>&#8220;<\/span>Serial Number<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n\n<tr id='Exposure'><td> Exposure <\/td>            <td><p>The photo's exposure data, like <span class='QO'>&#8220;<\/span>1\/250 sec at f\/5.0<span class='QC'>&#8221;<\/span>.<\/p>\n\n<p>You can supply an argument to change how the shutter speed and aperture are combined: <span class='QO'>&#8220;<\/span>SS<span class='QC'>&#8221;<\/span> within the argument is replaced by the shutter speed text,\nand <span class='QO'>&#8220;<\/span>AP<span class='QC'>&#8221;<\/span> is replaced by the aperture text.\n\n<span class='nobr'>A bare<\/span> <span class='token'>{Exposure}<\/span> is the same as <span class='token'>{Exposure=SS at AP}<\/span>.<\/p>\n\n<p>You might, for example, use <span class='token'>{Exposure=SS @ AP}<\/span> so as to end up with <span class='QO'>&#8220;<\/span>1\/250 sec @ f\/5.0<span class='QC'>&#8221;<\/span>.<\/p>\n\n<\/td><\/tr>\n\n\n<tr id='ExposureBias'><td> ExposureBias <\/td>        <td>The photo's exposure-bias setting, like <span class='QO'>&#8220;<\/span>-1 EV<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='ExposureBiasNum'><td> ExposureBiasNum <\/td>     <td>The photo's exposure-bias setting, as <span class='nobr'>a raw<\/span> number.<\/td><\/tr>\n<tr id='ExposureProgram'><td> ExposureProgram <\/td>     <td>The photo's exposure-program setting, like <span class='QO'>&#8220;<\/span>Aperture priority<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='Flash'><td> Flash <\/td>               <td>One of <span class='QO'>&#8220;<\/span>no flash<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>flash fired<span class='QC'>&#8221;<\/span>, or <span class='QO'>&#8220;<\/span>unknown flash<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='FocalLength'><td> FocalLength <\/td>         <td>Focal Length, as <span class='nobr'>a number<\/span><\/td><\/tr>\n<tr id='FocalLength35'><td> FocalLength35 <\/td>       <td>Focal Length in 35mm format, as <span class='nobr'>a number<\/span><\/td><\/tr>\n<tr id='FocalLength35MM'><td> FocalLength35MM <\/td>     <td>Focal Length in 35mm format (with locale-specific <span class='QO'>&#8220;<\/span>mm<span class='QC'>&#8221;<\/span> appended)<\/td><\/tr>\n<tr id='FocalLengthMM'><td> FocalLengthMM <\/td>       <td>Focal Length (with locale-specific <span class='QO'>&#8220;<\/span>mm<span class='QC'>&#8221;<\/span> appended)<\/td><\/tr>\n\n\n\n<tr id='ISO'><td> ISO <\/td>                 <td><p>The photo's ISO (sensor sensitivity) number.<\/p>\n<p>You can provide an argument to change how the number is displayed; within it, any <span class='QO'>&#8220;<\/span>#<span class='QC'>&#8221;<\/span> is replaced by the ISO sensitivity number.\nFor example <span class='QO'>&#8220;<\/span><span class='token'>{ISO=ISO #}<\/span><span class='QC'>&#8221;<\/span> becomes something like <span class='QO'>&#8220;<\/span>ISO 1200<span class='QC'>&#8221;<\/span> when the photo has ISO data, but becomes nothing when it doesn't.\n(Compare that to <span class='QO'>&#8220;<\/span><span class='token'>ISO&nbsp;{ISO}<\/span><span class='QC'>&#8221;<\/span>, which becomes <span class='QO'>&#8220;<\/span>ISO&nbsp;<span class='QC'>&#8221;<\/span> when the photo has no ISO data.<\/p>\n\n\n<\/td><\/tr>\n\n\n\n<tr id='Lens'><td> Lens <\/td>                <td>The photo's lens information, like <span class='QO'>&#8220;<\/span>24-70mm f\/2.8<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n\n<tr id='LensInfo'><td> LensInfo <\/td>                <td><p>Like <span class='token'>{Lens}<\/span> except that for zoom lenses it also includes the focal length that the photo was shot, such as <span class='QO'>&#8220;<\/span>24-70mm f\/2.8 @ 50 mm<span class='QC'>&#8221;<\/span>.<\/p>\n\n<p> You can provide an argument to configure how the basic lens info is presented along with the focal length: <span class='QO'>&#8220;<\/span>LENS<span class='QC'>&#8221;<\/span> is replaced by the basic lens info\n(the same as the <span class='token'>{Lens}<\/span> token), while <span class='QO'>&#8220;<\/span>FL<span class='QC'>&#8221;<\/span> is replaced by the focal-length info.\n<span class='nobr'>A bare<\/span> <span class='QO'>&#8220;<\/span><span class='token'>{LensInfo}<\/span><span class='QC'>&#8221;<\/span> is the same as <span class='QO'>&#8220;<\/span><span class='token'>{LensInfo=LENS @ FL}<\/span><span class='QC'>&#8221;<\/span>. <span class='nobr'>You might<\/span> instead use <span class='QO'>&#8220;<\/span><span class='token'>{LensInfo=LENS at FL}<\/span><span class='QC'>&#8221;<\/span> if you prefer <span class='QO'>&#8220;<\/span>at<span class='QC'>&#8221;<\/span> to <span class='QO'>&#8220;<\/span>@<span class='QC'>&#8221;<\/span>, as in\n<span class='QO'>&#8220;<\/span>24-70mm f\/2.8 at 50 mm<span class='QC'>&#8221;<\/span>.<\/p>\n\n\n\n\n<tr id='MeteringMode'><td> MeteringMode <\/td>        <td>The photo's metering-mode setting, like <span class='QO'>&#8220;<\/span>Pattern<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='ShutterSpeed'><td> ShutterSpeed <\/td>        <td>The shutter speed, formatted like <span class='QO'>&#8220;<\/span>1\/60 sec<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='ShutterSpeedNum'><td> ShutterSpeedNum <\/td>     <td>The shutter speed as <span class='nobr'>a floating<\/span>-point number of seconds; Use the <span class='QO'>&#8220;<\/span>Places<span class='QC'>&#8221;<\/span> filter to limit precision.<\/td><\/tr>\n<tr id='SubjectDistance'><td> SubjectDistance <\/td>     <td>The subject distance as reported by the lens, formatted like <span class='QO'>&#8220;<\/span>1.2 m<span class='QC'>&#8221;<\/span>. Often wildly inaccurate.<\/td><\/tr>\n<tr id='SubjectDistanceNum'><td> SubjectDistanceNum <\/td>  <td>The subject distance as reported by the lens, as <span class='nobr'>a floating<\/span>-point number. Often wildly inaccurate.<\/td><\/tr>\n\n\n<tr><td colspan='2'>Attributes<\/td><\/tr>\n\n<tr id='CopyName'><td> CopyName <\/td>         <td>The name of the copy (master or virtual) being exported, if any<\/td><\/tr>\n<tr id='Rating'><td> Rating <\/td>           <td>The number of stars assigned to the image: <span class='QO'>&#8220;<\/span>0<span class='QC'>&#8221;<\/span> through <span class='QO'>&#8220;<\/span>5<span class='QC'>&#8221;<\/span>. <span class='nobr'>You can also<\/span> use with an argument, e.g. <span class='token'>{Rating=*}<\/span> or <span class='token'>{Rating=great&nbsp;}<\/span> to have, for example, <span class='nobr'>a three<\/span>-star photo result in <span class='QO'>&#8220;<\/span>***<span class='QC'>&#8221;<\/span> or <span class='QO'>&#8220;<\/span>great great great<span class='QC'>&#8221;<\/span>. <span class='nobr'>In either<\/span> case, <span class='nobr'>a photo<\/span> with <span class='nobr'>a zero<\/span> rating results in nothing, but you can combine tokens (as described below) along these lines: <span class='token'>{Rating=*|&#34;unrated&#34;}<\/span>.<\/td><\/tr>\n<tr id='FlagStatus'><td> FlagStatus <\/td>       <td>This becomes <span class='QO'>&#8220;<\/span>Pick<span class='QC'>&#8221;<\/span> if the image is flagged as <span class='nobr'>a pick,<\/span> nothing if the image is not flagged, and <span class='QO'>&#8220;<\/span>Rejected<span class='QC'>&#8221;<\/span> if the image is flagged as rejected. <span class='nobr'>You can substitute<\/span> your own phrases for each by using the form\n<span class='token'>{FlagStatus=<i>X<\/i>,<i>Y<\/i>,<i>Z<\/i>}<\/span>, where <i>X<\/i>, <i>Y<\/i>, and <i>Z<\/i> are used for <i>Pick<\/i>, nothing, and <i>Rejected<\/i>, respectively.\nFor example: <span class='QO'>&#8220;<\/span><span class='token'>{FlagStatus=Super!,okay,no good}<\/span><span class='QC'>&#8221;<\/span>\nor\n<span class='QO'>&#8220;<\/span><span class='token'>{FlagStatus=,, (rejected)}<\/span><span class='QC'>&#8221;<\/span>\n<\/td><\/tr>\n\n<tr id='ColorLabel'><td> ColorLabel <\/td>       <td>The <span class='QO'>&#8220;<\/span>Label<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='EditCount'><td> EditCount <\/td>        <td><span class='nobr'>A number<\/span> that goes up each time <span class='nobr'>a change<\/span> is made in Lightroom to the image or its data.<\/td><\/tr>\n<tr id='UUID'><td> UUID <\/td>             <td>Lightroom's internal unique identifier for the photo, an essentially-random 36-character sequence of letters, numbers, and hyphens, such as\n<span class='QO'>&#8220;<\/span><b style='font-size:small' class='nobr'>FB4D3F92-455F-47CA-8B7B-7C885F7244FD<\/b><span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n\n\n<tr><td colspan='2'>Location<\/td><\/tr>\n\n<tr id='Latitude'><td> Latitude <\/td>         <td>Latitude, as <span class='nobr'>a floating<\/span>-point number. Use <span class='QO'>&#8220;<\/span>Places<span class='QC'>&#8221;<\/span>, e.g. <span class='token'>{Latitude:Places=4}<\/span>, to limit precision.<\/td><\/tr>\n<tr id='Longitude'><td> Longitude <\/td>        <td>Longitude, as <span class='nobr'>a floating<\/span>-point number. Use <span class='QO'>&#8220;<\/span>Places<span class='QC'>&#8221;<\/span>, e.g. <span class='token'>{Longitude:Places=4}<\/span>, to limit precision.<\/td><\/tr>\n\n<tr id='GPSCoords'><td> GPSCoords <\/td>   <td>The photo's geoencoded coordinates in decimal format, such as <span class='nobr'><span class='QO'>&#8220;<\/span>40.689253,-74.046694<span class='QC'>&#8221;<\/span><\/span><\/td><\/tr>\n\n<tr id='GPSCoordinates'><td> GPSCoordinates <\/td>   <td>The photo's geoencoded coordinates in degree-minute-second format, such as <span class='nobr'><span class='QO'>&#8220;<\/span>35&deg;1'11.51&#34; N 135&deg;46'16.05&#34; E<span class='QC'>&#8221;<\/span><\/span><\/td><\/tr>\n\n<tr id='PlusCode'><td> PlusCode <\/td>         <td>\n\n   <p>The <a href='https:\/\/plus.codes\/'>Plus Code<\/a> for the geoencoded location. <span class='nobr'>The default<\/span> precision is 12,\n   so for the Statue of Liberty <span class='token'>{PlusCode}<\/span> becomes <span class='QO'>&#8220;<\/span><b>87G7MXQ4+M5PM<\/b><span class='QC'>&#8221;<\/span>.<\/p>\n\n   <p>Use in the form <span class='token'>{PlusCode=10}<\/span> to set more or less precision.<\/p>\n\n   <p>You can get the short form of <span class='nobr'>a PlusCode<\/span> by providing <span class='nobr'>a reference<\/span> location; For example,\n<span class='token'>{PlusCode=ref=40.72,-74.00}<\/span> returns short codes for locations in and around New York City, but long codes otherwise.<\/p>\n\n<p>You can combine combine precision with <span class='nobr'>a reference<\/span> location: <span class='token'>{PlusCode=10,ref=40.72,-74.00}<\/span>.<\/p>\n\n\n<tr id='GeoHash'><td> GeoHash <\/td> <td> The <a href='https:\/\/en.wikipedia.org\/wiki\/Geohash'>geohash<\/a> for the geoencoded location.<\/td><\/tr>\n\n\n<tr id='Altitude'><td> Altitude <\/td>         <td>The photo's geoencoded altitude, as <span class='nobr'>a number,<\/span> in meters.\nUse <span class='QO'>&#8220;<\/span>Places<span class='QC'>&#8221;<\/span>, e.g. <span class='token'>{Altitude:Places=0}<\/span>, to limit precision.<\/td><\/tr>\n\n<tr id='GPSAltitude'><td> GPSAltitude <\/td>      <td>The photo's geoencoded as <span class='nobr'>a description,<\/span> e.g. <span class='QO'>&#8220;<\/span><b>27.3 m<\/b><span class='QC'>&#8221;<\/span><\/td><\/tr>\n\n<tr id='ImageViewDirection'><td> ImageViewDirection <\/td> <td>The direction that the camera was facing when the image was taken, e.g. <span class='QO'>&#8220;<\/span>North<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>West<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>South-East<span class='QC'>&#8221;<\/span>, etc.<\/td><\/tr>\n\n<tr id='ImageViewBearing'><td> ImageViewBearing <\/td> <td>The compass bearing that the camera was facing when the image was taken, as <span class='nobr'>a number<\/span> of degrees from North.<\/td><\/tr>\n\n\n<tr id='SpeedKPH'><td> SpeedKPH <\/td>     <td>If the photo was geoencoded via tracklog with <a href='\/blog\/lightroom-goodies\/gps'>my <span class='QO'>&#8220;<\/span>Geoencoding Support<span class='QC'>&#8221;<\/span> plugin<\/a>, this becomes <span class='nobr'>a string<\/span> like <span class='QO'>&#8220;<\/span>24.7 kph<span class='QC'>&#8221;<\/span><\/td><\/tr>\n\n<tr id='SpeedMPH'><td> SpeedMPH <\/td>     <td>Like <span class='token'>{SpeedKPH}<\/span>, but MPH (e.g. <span class='QO'>&#8220;<\/span>15.3 mph<span class='QC'>&#8221;<\/span>)<\/td><\/tr>\n\n<tr id='SpeedKnots'><td> SpeedKnots <\/td>     <td>Like <span class='token'>{SpeedKPH}<\/span>, but in knots (e.g. <span class='QO'>&#8220;<\/span>13.3 knots<span class='QC'>&#8221;<\/span>)<\/td><\/tr>\n\n<tr id='TempC'><td> TempC <\/td>\n   <td>\n      <p>If the photo was geoencoded via tracklog with <a href='\/blog\/lightroom-goodies\/gps'>my <span class='QO'>&#8220;<\/span>Geoencoding\n       Support<span class='QC'>&#8221;<\/span> plugin<\/a>, and that tracklog included temperature information, this becomes <span class='nobr'>a string<\/span>\n       like <span class='QO'>&#8220;<\/span>24\u00b0C<span class='QC'>&#8221;<\/span>.<\/p>\n\n      <p>If provided the argument <span class='QO'>&#8220;<\/span><span class='token'>raw<\/span><span class='QC'>&#8221;<\/span> (that is,\n      <span class='QO'>&#8220;<\/span><span class='token'>{TempC=raw}<\/span><span class='QC'>&#8221;<\/span>) then whatever is in the\n      plugin's <span class='QO'>&#8220;<\/span>Temperature<span class='QC'>&#8221;<\/span> field is passed through unchanged (even if it's Fahrenheit).<\/p>\n\n      <p>If any other argument is given, that argument is used, but with each <span class='QO'>&#8220;<\/span><tt>#<\/tt><span class='QC'>&#8221;<\/span>\n       character in it replaced by the temperature number: for example,\n           <span class='QO'>&#8220;<\/span><span class='token'>{TempC=it was # degrees}<\/span><span class='QC'>&#8221;<\/span>\n      might become <span class='QO'>&#8220;<\/span><i>it was 24 degrees<\/i><span class='QC'>&#8221;<\/span>.<\/p>\n  <\/td><\/tr>\n\n<tr id='TempF'><td> TempF <\/td>\n   <td>\n      <p>If the photo was geoencoded via tracklog with <a href='\/blog\/lightroom-goodies\/gps'>my <span class='QO'>&#8220;<\/span>Geoencoding\n       Support<span class='QC'>&#8221;<\/span> plugin<\/a>, and that tracklog included temperature information, this becomes <span class='nobr'>a string<\/span>\n       like <span class='QO'>&#8220;<\/span>75\u00b0F<span class='QC'>&#8221;<\/span>.<\/p>\n\n      <p>If provided the argument <span class='QO'>&#8220;<\/span><span class='token'>raw<\/span><span class='QC'>&#8221;<\/span> (that is,\n      <span class='QO'>&#8220;<\/span><span class='token'>{TempF=raw}<\/span><span class='QC'>&#8221;<\/span>) then whatever is in the\n      plugin's <span class='QO'>&#8220;<\/span>Temperature<span class='QC'>&#8221;<\/span> field is passed through unchanged (even if it's Celsius).<\/p>\n\n      <p>If any other argument is given, that argument is used, but with each <span class='QO'>&#8220;<\/span><tt>#<\/tt><span class='QC'>&#8221;<\/span>\n       character in it replaced by the temperature number: for example,\n           <span class='QO'>&#8220;<\/span><span class='token'>{TempF=it was # degrees}<\/span><span class='QC'>&#8221;<\/span>\n      might become <span class='QO'>&#8220;<\/span><i>it was 75 degrees<\/i><span class='QC'>&#8221;<\/span>.<\/p>\n  <\/td><\/tr>\n\n\n\n<tr id='IfGeoencoded'><td> IfGeoencoded <\/td>     <td>If used in the form <span class='token'>{IfGeoencoded=<i>some text here<\/i>}<\/span>, the token is replaced by the text after the <span class='QO'>&#8220;<\/span><b>=<\/b><span class='QC'>&#8221;<\/span> if the photo is geoencoded, or replaced by nothing if not. <span class='nobr'>If used in<\/span> the form <span class='token'>{IfGeoencoded=<i>some text here<\/i><b>;<\/b><i>for non-geoencoded<\/i>}<\/span> with <span class='nobr'>a semicolon,<\/span> the text after the semicolon is used when the photo is not geoencoded.<\/td><\/tr>\n<tr id='Location'><td> Location <\/td>         <td>The <span class='QO'>&#8220;<\/span>Location<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='City'><td> City <\/td>             <td>The <span class='QO'>&#8220;<\/span>City<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='State'><td> State <\/td>            <td>The <span class='QO'>&#8220;<\/span>State<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='Province'><td> Province <\/td>      <td><span class='nobr'>A synonym<\/span> for <span class='token'>{State}<\/span><\/td><\/tr>\n<tr id='Country'><td> Country <\/td>          <td>The <span class='QO'>&#8220;<\/span>Country<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='CountryCode'><td> CountryCode <\/td>      <td>The photo's <span class='QO'>&#8220;<\/span>Image &gt; ISO Country Code<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n\n\n<tr><td colspan='2' id='artwork_or_object'><span class='QO'>&#8220;<\/span>Artwork or Object<span class='QC'>&#8221;<\/span><\/td><\/tr>\n<tr id='Artworks'><td> Artworks <\/td><td>IPTC Extended <span class='QO'>&#8220;<\/span>Artwork or Object<span class='QC'>&#8221;<\/span> records, presented as <span class='nobr'>a comma<\/span>-separated\nset of <span class='QO'>&#8220;<\/span><i>Title\/Copyright\/Creator\/Date\/Source\/InventoryNum<\/i><span class='QC'>&#8221;<\/span>, though missing items are omitted.\n<span class='token'>{Artworks=1}<\/span> shows just the first recorded artwork,\n<span class='token'>{Artworks=2}<\/span> shows just the second, etc.\n<\/td><\/tr>\n\n<tr id='ArtworkTitle'><td> ArtworkTitle <\/td><td> The list of <span class='QO'>&#8220;<\/span>Artwork or Object<span class='QC'>&#8221;<\/span> titles registered for the photo, separated by commas.\n<span class='token'>{ArtworkTitle=1}<\/span> shows just the first title, <span class='token'>{ArtworkTitle=2}<\/span> just the second, etc.<\/td><\/tr>\n\n<tr id='ArtworkCopyright'><td> ArtworkCopyright <\/td><td> Like <span class='token'>{ArtworkTitle}<\/span>, but for the artwork copyright.<\/td><\/tr>\n<tr id='ArtworkCreator'><td> ArtworkCreator <\/td><td> Like <span class='token'>{ArtworkTitle}<\/span>, but for the artwork creator.<\/td><\/tr>\n<tr id='ArtworkDateCreated'><td> ArtworkDateCreated <\/td><td> Like <span class='token'>{ArtworkTitle}<\/span>, but for the artwork date created.<\/td><\/tr>\n<tr id='ArtworkSource'><td> ArtworkSource <\/td><td> Like <span class='token'>{ArtworkTitle}<\/span>, but for the artwork source<\/td><\/tr>\n<tr id='ArtworkInventoryNum'><td> ArtworkInventoryNum <\/td><td> Like <span class='token'>{ArtworkTitle}<\/span>, but for the artwork inventory control number.<\/td><\/tr>\n\n\n<tr><td colspan='2'>Other Metadata<\/td><\/tr>\n\n\n\n<tr id='Artist'><td> Artist <\/td>           <td>The <span class='QO'>&#8220;<\/span>Artist<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='Caption'><td> Caption <\/td>          <td>The <span class='QO'>&#8220;<\/span>Caption<span class='QC'>&#8221;<\/span> metadata string<\/td><\/tr>\n<tr id='Category'><td> Category <\/td>         <td>The photo's <span class='QO'>&#8220;<\/span>IPTC &gt; Category<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n\n<tr id='Copyright'><td> Copyright <\/td>        <td><p>\n\nThe <span class='QO'>&#8220;<\/span>Copyright<span class='QC'>&#8221;<\/span> metadata item (usually the name of <span class='nobr'>a person<\/span> or company).<\/p>\n\n<p>You can provide an argument to change how the copyright name is presented; in it, <span class='QO'>&#8220;<\/span>NAME<span class='QC'>&#8221;<\/span> is replaced by the name from the photo metadata, <span class='QO'>&#8220;<\/span>YYYY<span class='QC'>&#8221;<\/span> is replaced by\nthe year of the photo-capture time, and <span class='QO'>&#8220;<\/span>yyyy<span class='QC'>&#8221;<\/span> is replaced by the current year.<\/p>\n\n<p>So, a bare <span class='token'>{Copyright}<\/span> is the same as <span class='token'>{Copyright=NAME}<\/span>, but also consider\n<span class='token'>{Copyright=\u00a9NAME}<\/span> to end up with something like <span class='QO'>&#8220;<\/span>\u00a9Jeffrey Friedl<span class='QC'>&#8221;<\/span>, or perhaps <span class='token'>{Copyright=Copyright YYYY NAME}<\/span>\nto end up with <span class='QO'>&#8220;<\/span>Copyright 2019 Jeffrey Friedl<span class='QC'>&#8221;<\/span>.\nThese have advantage over <span class='QO'>&#8220;<\/span><span class='token'>\u00a9{Copyright}<\/span><span class='QC'>&#8221;<\/span> and <span class='QO'>&#8220;<\/span><span class='token'>Copyright {YYYY} {Copyright}<\/span><span class='QC'>&#8221;<\/span> in that they remain\nblank\/empty when the photo has no copyright info.<\/p>\n\n<\/td><\/tr>\n\n\n\n<tr id='CopyrightUrl'><td> CopyrightUrl <\/td>     <td>The photo's <span class='QO'>&#8220;<\/span>Copyright Info Url<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Creator'><td> Creator <\/td>          <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; Creator<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorAddress'><td> CreatorAddress <\/td>   <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; Address<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorCity'><td> CreatorCity <\/td>      <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; City<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorCountry'><td> CreatorCountry <\/td>   <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; Country<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorEmail'><td> CreatorEmail <\/td>     <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; E-Mail<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorJobTitle'><td> CreatorJobTitle <\/td>  <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; Job Title<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorPhone'><td> CreatorPhone <\/td>     <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; Phone<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorState'><td> CreatorState <\/td>     <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; State \/ Province<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorUrl'><td> CreatorUrl <\/td>       <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; Website<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='CreatorZip'><td> CreatorZip <\/td>       <td>The photo's <span class='QO'>&#8220;<\/span>Contact &gt; Postal Code<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='DescriptionWriter'><td> DescriptionWriter <\/td><td>The photo's <span class='QO'>&#8220;<\/span>IPTC &gt; Description Writer<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Genre'><td> Genre <\/td>            <td>The photo's <span class='QO'>&#8220;<\/span>Image &gt; Intellectual Genre<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Headline'><td> Headline <\/td>         <td>The <span class='QO'>&#8220;<\/span>Headline<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='Instructions'><td> Instructions <\/td>     <td>The photo's <span class='QO'>&#8220;<\/span>Workflow &gt; Instructions<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='JobIdentifier'><td> JobIdentifier <\/td>    <td>The photo's <span class='QO'>&#8220;<\/span>Workflow &gt; Job Identifier<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Keywords'><td> Keywords <\/td>         <td>\n\n<p>The list of the photo's marked-for-export keywords, separated by commas. (Actually, there's <span class='nobr'>a\ncomma<\/span>+space pair between each keyword, so it's <span class='QO'>&#8220;<\/span>plant, rose, flower<span class='QC'>&#8221;<\/span> and not\n<span class='QO'>&#8220;<\/span>plant,rose,flower<span class='QC'>&#8221;<\/span>.)<\/p>\n\n<p>Supports special filters:<\/p>\n\n<p>The <span class='token'>ChildOf<\/span> and <span class='token'>DescendantOf<\/span> filters, used in the form <span\nclass='QO'>&#8220;<\/span><span class='token'>{Keywords:ChildOf=<i>parent<\/i>}<\/span><span class='QC'>&#8221;<\/span> to include\nonly keywords that are direct children of the named <i>parent<\/i> keyword. (<span class='token'>DescendantOf<\/span>, obviously,\nallows indirect children as well.)<\/p>\n\n<p>The <span class='token'>H<\/span> filter has each keyword expand hierarchically, with each level separated by the text argument of the filter.\nFor example, <span class='token'>{Keywords:H=&nbsp;&gt;&gt;&nbsp;}<\/span> might result in a\n<span class='nobr'><span class='QO'>&#8220;<\/span>San Francisco<span class='QC'>&#8221;<\/span><\/span> keyword\nexpand to\n<span class='nobr'><span class='QO'>&#8220;<\/span>USA&nbsp;&gt;&gt;&nbsp;California&nbsp;&gt;&gt;&nbsp;San Francisco<span class='QC'>&#8221;<\/span><\/span>.<\/p>\n\n<p>The <span class='token'>HR<\/span> filter is the same as the <span class='token'>H<\/span> filter, except that the hierarchical order is reversed.\nContinuing with the previous example, <span class='token'>{Keywords:HR=&nbsp;&lt;&lt;&nbsp;}<\/span> might result in\n<span class='nobr'><span class='QO'>&#8220;<\/span>San Francisco&nbsp;&lt;&lt;&nbsp;California&nbsp;&lt;&lt;&nbsp;USA<span class='QC'>&#8221;<\/span><\/span>.<\/p>\n\n<p>Filters can be stacked up to two deep: <span class='token'>{Keywords:DescendantOf=USA:H=&nbsp;&gt;&gt;&nbsp;}<\/span>.  However, some combinations of filters won't parse properly, due to my poor design very early on, sorry.<\/p>\n\n\n\n<p>Note: in implementing these special filters, <span class='nobr'>I had to<\/span> use <span class='nobr'>a different<\/span> method to access the photo keywords than when no filters are\nused, and this can result in two differences: one is that without filters, Lightroom includes keywords even if they're\nnot assigned to the photo, if that unassigned keyword has <span class='nobr'>a descendant<\/span> keyword that is assigned. When <span class='nobr'>a filter<\/span> is used, only keywords\nexplicitly added to <span class='nobr'>a photo<\/span> are included.<\/p>\n\n<p>Secondly, the order in which keywords appear may differ depending on whether filters are used.<\/p>\n\n<p><b>If you don't use filters<\/b>, you can use <span class='nobr'>a special<\/span> form where you can dress up each keyword:\nfor example, <span class='token nobr'>{Keywords=[%s]})<\/span> might result in\n<span class='nobr'><span class='QO'>&#8220;<\/span>[Paris], [landmark], [tower]<span class='QC'>&#8221;<\/span><\/span>. <span class='nobr'>In this special<\/span> form, the text after\nthe equal sign is used, with the <span class='QO'>&#8220;<\/span><tt>%s<\/tt><span class='QC'>&#8221;<\/span> marking where the keyword itself should be placed. <span class='nobr'>In the example<\/span>, that text is <span class='QO'>&#8220;<\/span><tt>[%s]<\/tt><span class='QC'>&#8221;<\/span>, so each keyword gets wrapped in square brackets.<\/p>\n\n<\/td><\/tr>\n\n<tr id='KeywordsAll'><td> KeywordsAll <\/td>      <td>The same as <span class='token'>Keywords<\/span>, but also includes keywords not marked for export<\/td><\/tr>\n\n\n\n\n<tr id='IfKeyword'><td> IfKeyword <\/td>     <td>\n\n<p>If used in the form <span class='token'>{IfKeyword=<i>keyword<\/i><b>;<\/b><i>some text here<\/i>}<\/span>, the token is\nreplaced by the text after the <span class='QO'>&#8220;<\/span><b>=<\/b><span class='QC'>&#8221;<\/span> if the photo has been tagged with the named <i>keyword<\/i> (even if that keyword is not marked in Lightroom as one to be exported). <span class='nobr'>If no text<\/span> is given after the semicolon, the keyword itself is used:\n\n<span class='token'>{IfKeyword=public;}<\/span> becomes \"public&#8220; or nothing.<\/p>\n\n<p> If used in the form <span style='font-size:small' class='token'>{IfKeyword=<i>keyword<\/i><b>;<\/b><i>some text here<\/i><b>;<\/b><i>the\nnot-keyworded text<\/i>}<\/span>, with an extra semicolon-separated phrase, the token becomes <i>the not-keyworded<\/i> if\nthe photo is not tagged with the named <i>keyword<\/i>.<\/p><\/td><\/tr>\n\n<tr id='IfExportedKeyword'><td> IfExportedKeyword <\/td>     <td>\nLike <span class='token'>IfKeyword<\/span>, but considers only keywords that have been marked in Lightroom for export.<\/td><\/tr>\n\n<tr id='OtherCategories'><td> OtherCategories <\/td>          <td>The photo's &#8220;IPTC &gt; Other Categories\" metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Provider'><td> Provider <\/td>                 <td>The photo's <span class='QO'>&#8220;<\/span>Workflow &gt; Provider<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='RightsUsageTerms'><td> RightsUsageTerms <\/td>         <td>The photo's <span class='QO'>&#8220;<\/span>Workflow &gt; Rights Usage Terms<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Scene'><td> Scene <\/td>                    <td>The <span class='QO'>&#8220;<\/span>Scene<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='Software'><td> Software <\/td>                 <td>The photo's <span class='QO'>&#8220;<\/span>Software<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Source'><td> Source <\/td>                   <td>The <span class='QO'>&#8220;<\/span>Source<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='SubjectCode'><td> SubjectCode <\/td>              <td>The photo's <span class='QO'>&#8220;<\/span>IPTC &gt; IPTC Subject Code<span class='QC'>&#8221;<\/span> metadata item in Lightroom's database.<\/td><\/tr>\n<tr id='Title'><td> Title <\/td>                    <td>The <span class='QO'>&#8220;<\/span>Title<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='PersonShown'><td> PersonShown <\/td>              <td>The <span class='QO'>&#8220;<\/span>Person Shown<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='People'><td> People <\/td>                   <td>See <a href='\/blog\/lightroom-goodies\/people-support#token'>here<\/a>.<\/td><\/tr>\n<tr id='NameOfOrgShown'><td> NameOfOrgShown <\/td>           <td>The <span class='QO'>&#8220;<\/span>Name of Organization Shown<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='CodeOfOrgShown'><td> CodeOfOrgShown <\/td>           <td>The <span class='QO'>&#8220;<\/span>Code of Organization Shown<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='Event'><td> Event <\/td>                    <td>The <span class='QO'>&#8220;<\/span>Event<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='AdditionalModelInfo'><td> AdditionalModelInfo <\/td>      <td>The <span class='QO'>&#8220;<\/span>Additional Model Info<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='ModelAge'><td> ModelAge <\/td>                 <td>The <span class='QO'>&#8220;<\/span>Model Age<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='MinorModelAge'><td> MinorModelAge <\/td>            <td>The <span class='QO'>&#8220;<\/span>Minor Model Age<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='ModelReleaseStatus'><td> ModelReleaseStatus <\/td>       <td>The <span class='QO'>&#8220;<\/span>Model Release Status<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='ModelReleaseID'><td> ModelReleaseID <\/td>           <td>The <span class='QO'>&#8220;<\/span>Model Release ID<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='ImageSupplierImageId'><td> ImageSupplierImageId <\/td>     <td>The <span class='QO'>&#8220;<\/span>Image Supplier ImageId<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='SourceType'><td> SourceType <\/td>               <td>The <span class='QO'>&#8220;<\/span>Source Type<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='PropertyReleaseID'><td> PropertyReleaseID <\/td>        <td>The <span class='QO'>&#8220;<\/span>Property Release ID<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='PropertyReleaseStatus'><td> PropertyReleaseStatus <\/td>    <td>The <span class='QO'>&#8220;<\/span>Property Release Status<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='DigImageGUID'><td> DigImageGUID <\/td>             <td>The <span class='QO'>&#8220;<\/span>Digital-Image GUID<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n<tr id='PlusVersion'><td> PlusVersion <\/td>              <td>The <span class='QO'>&#8220;<\/span>Plus Version<span class='QC'>&#8221;<\/span> metadata item<\/td><\/tr>\n\n\n<tr><td colspan='2'>Online Presence<\/td><\/tr>\n\n<tr id='ExposureManagerUrl'><td> ExposureManagerUrl <\/td>           <td>The url of the image at ExposureManager (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/exposuremanager' class='quiet'>my Upload-to-ExposureManager plugin<\/a>)<\/td><\/tr>\n<tr id='FacebookUrl'><td> FacebookUrl <\/td>           <td>The url of the image at Facebook (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/facebook' class='quiet'>my Upload-to-Facebook plugin<\/a>)<\/td><\/tr>\n<tr id='PhotobucketUrl'><td> PhotobucketUrl <\/td>           <td>The url of the image at Photobucket (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/photobucket' class='quiet'>my Upload-to-Photobucket plugin<\/a>)<\/td><\/tr>\n<tr id='PicasawebUrl'><td> PicasawebUrl <\/td>        <td>The url of the image at PicasaWeb (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/picasaweb' class='quiet'>my Upload-to-PicasaWeb plugin<\/a>)<\/td><\/tr>\n<tr id='SmugMugUrl'><td> SmugMugUrl <\/td>          <td>The url of the image at SmugMug (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/smugmug' class='quiet'>my Upload-to-SmugMug plugin<\/a>)<\/td><\/tr>\n<tr id='ZenfolioUrl'><td> ZenfolioUrl <\/td>         <td>The url of the image at Zenfolio (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/zenfolio' class='quiet'>my Upload-to-Zenfolio plugin<\/a>)<\/td><\/tr>\n<tr id='FlickrUrl'><td> FlickrUrl <\/td>           <td>The url of the image at Flickr (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/flickr' class='quiet'>my Upload-to-Flickr plugin<\/a>)<\/td><\/tr>\n<tr id='IpernityUrl'><td> IpernityUrl <\/td>           <td>The url of the image at Ipernity (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/ipernity' class='quiet'>my Upload-to-Ipernity plugin<\/a>)<\/td><\/tr>\n<tr id='TumblrUrl'><td> TumblrUrl <\/td>           <td>The url of the image at Tumblr (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/tumblr' class='quiet'>my Upload-to-Tumblr plugin<\/a>)<\/td><\/tr>\n<tr id='GoogleDriveUrl'><td> GoogleDriveUrl <\/td>           <td>The url of the image at Google Drive (only if previously uploaded with <a href='\/blog\/lightroom-goodies\/google-drive' class='quiet'>my Upload-to-Google-Drive plugin<\/a>)<\/td><\/tr>\n\n<tr id='OnlineID'><td> OnlineID <\/td>            <td><p><b>Flickr plugin only.<\/b>  The Flickr ID of the image.\nThis allows you to create <span class='nobr'>a description<\/span> preset along the lines of:<\/p>\n\n  <pre style='font-size:75%'>&lt;a href<span>=<\/span>\"http:\/\/BigHugeLabs.com\/flickr\/onblack.php?id=<b>{OnlineID}<\/b>\"&gt;View on Black&lt;\/a&gt;<\/pre>\n\n<p>which creates a result at Flickr <a href='http:\/\/www.flickr.com\/photos\/94287843@N00\/3378751492\/'>like this<\/a>,\nwhich includes <span class='nobr'>a link<\/span> with <a href='http:\/\/bighugelabs.com\/flickr\/onblack.php?id=3378751492&amp;size=large'>this result<\/a>.<\/p>\n<\/td><\/tr>\n\n<tr id='Urls'><td> Urls <\/td> <td>The list of URLs saved among plugin custom metadata (such as the various URLs listed above), one per line.\n(An example of this in use can be seen with my <a href='\/blog\/lightroom-goodies\/bag-o-goodies#copy-to-clipboard'>Bag-o-Goodies plugin<\/a>.<\/td><\/tr>\n\n\n<tr><td colspan='2'>Export Type<\/td><\/tr>\n\n<tr id='ExportFormat'><td> ExportFormat <\/td><td> The kind of export file format being produced (JPEG, PSD, etc)<\/td><\/tr>\n<tr id='ExportQuality'><td> ExportQuality <\/td><td> When the export format is JPEG, the quality setting (0 - 100)<\/td><\/tr>\n<tr id='ExportBitDepth'><td> ExportBitDepth <\/td><td> When the export format is TIFF or PSD, the target bit depth (8 or 16)<\/td><\/tr>\n<tr id='ExportColorSpace'><td> ExportColorSpace <\/td><td> When the export format is not DNG or ORIGINAL, the target color space (e.g. <span class='QO'>&#8220;<\/span>sRGB<span class='QC'>&#8221;<\/span>)<\/td><\/tr>\n<tr id='ExportSharpeningLevel'><td> ExportSharpeningLevel <\/td><td> The export-sharpening level setting (blank if sharpening is off, <span class='QO'>&#8220;<\/span>Low<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>Standard<span class='QC'>&#8221;<\/span>, or <span class='QO'>&#8220;<\/span>High<span class='QC'>&#8221;<\/span>)<\/td><\/tr>\n<tr id='ExportSharpeningMedia'><td> ExportSharpeningMedia <\/td><td> The export-sharpening media type (blank if sharpening is off, <span class='QO'>&#8220;<\/span>Screen<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>Matte Paper<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>Glossy Paper<span class='QC'>&#8221;<\/span>)<\/td><\/tr>\n\n<tr><td colspan='2'>Publish<\/td><\/tr>\n\n<tr id='PublishCollectionName'><td> PublishCollectionName <\/td><td> <p>The name of the publish collection via which an image is being processed, blank otherwise.<\/p>\n\n<p style='color:#8CC'>Note: this always appears blank in previews shown in the Publishing Manager dialog... it has <span class='nobr'>a value<\/span> 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.<\/p>\n\n<p>You can use arguments like <span class='QO'>&#8220;<\/span>+0<span class='QC'>&#8221;<\/span> or <span class='QO'>&#8220;<\/span>-3<span class='QC'>&#8221;<\/span>, as described for <a class='token' href='\/blog\/lightroom-goodies\/template#FolderName'>FolderName<\/a>, to pluck out specific parts of <span class='nobr'>a publish<\/span> collection-set hierarchy.<\/p>\n\n<p style='font-size:small'> Due to how Lightroom's plugin infrastructure is built, supporting this properly is <span class='nobr'>a real<\/span> pain in the neck and <span class='nobr'>I may<\/span> have missed some situations. <span class='nobr'>If you find<\/span> it's not showing where you expect, please send me <span class='nobr'>a note<\/span> with <span class='nobr'>a clear<\/span> description of the situation.<\/p> <\/td><\/tr>\n\n<tr id='PublishCollectionDepth'><td> PublishCollectionDepth <\/td><td> <p>The depth of the publish collection via which an image is being processed. <span class='nobr'>A publish<\/span> collection at the root of its publish service gets <span class='QO'>&#8220;<\/span>1<span class='QC'>&#8221;<\/span>. <span class='nobr'>A publish<\/span> collection <i>within<\/i> <span class='nobr'>a root<\/span>-level publish collection set gets  <span class='QO'>&#8220;<\/span>2<span class='QC'>&#8221;<\/span>, and so on. <\/p>\n\n<p> Zero (<span class='QO'>&#8220;<\/span>0<span class='QC'>&#8221;<\/span>) if not within the context of <span class='nobr'>a publish<\/span> collection.<\/p>\n\n<p style='color:#8CC'>Note: this always appears blank in previews shown in the Publishing Manager dialog... it has <span class='nobr'>a value<\/span> 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.<\/p>\n\n<p style='font-size:small'> Due to how Lightroom's plugin infrastructure is built, supporting this properly is <span class='nobr'>a real<\/span> pain in the neck and <span class='nobr'>I may<\/span> have missed some situations. <span class='nobr'>If you find<\/span> it's not showing where you expect, please send me <span class='nobr'>a note<\/span> with <span class='nobr'>a clear<\/span> description of the situation.<\/p> <\/td><\/tr>\n\n<tr id='PublishServiceTitle'><td> PublishServiceTitle <\/td><td> <p>The title of the overall publish service via which an image is being processed, blank otherwise.<\/p>\n\n<p style='color:#8CC'>Note: this always appears blank in previews shown in the Publishing Manager dialog... it has <span class='nobr'>a value<\/span> 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.<\/p>\n\n<p style='font-size:small'> Due to how Lightroom's plugin infrastructure is built, supporting this properly is <span class='nobr'>a real<\/span> pain in the neck and <span class='nobr'>I may<\/span> have missed some situations. <span class='nobr'>If you find<\/span> it's not showing where you expect, please send me <span class='nobr'>a note<\/span> with <span class='nobr'>a clear<\/span> description of the situation.<\/p> <\/td><\/tr>\n\n\n<tr><td colspan='2'>System<\/td><\/tr>\n\n<tr id='LrVersion'><td> LrVersion <\/td>         <td> The version of Lightroom running, such as <span class='QO'>&#8220;<\/span>5.4<span class='QC'>&#8221;<\/span><\/td><\/tr>\n<tr id='LrVersionMajor'><td> LrVersionMajor <\/td>    <td> The major number of the Lightroom version, such as <span class='QO'>&#8220;<\/span>5<span class='QC'>&#8221;<\/span> for Lr5.4<\/td><\/tr>\n<tr id='LrVersionMinor'><td> LrVersionMinor <\/td>    <td> The minor number of the Lightroom version, such as <span class='QO'>&#8220;<\/span>4<span class='QC'>&#8221;<\/span> for Lr5.4<\/td><\/tr>\n<tr id='LrVersionRevision'><td> LrVersionRevision <\/td> <td> The sub-minor number of the Lightroom version, usually <span class='QO'>&#8220;<\/span>0<span class='QC'>&#8221;<\/span>.<\/td><\/tr>\n<tr id='LrVersionBuild'><td> LrVersionBuild <\/td>    <td> The build number of the current Lightroom install (usually <span class='nobr'>a six<\/span>-digit number).<\/td><\/tr>\n<tr id='CatalogName'><td> CatalogName <\/td>       <td> The name of the current catalog (the filename without leading path and without the <span class='QO'>&#8220;<\/span>.lrcat<span class='QC'>&#8221;<\/span> extension).<\/td><\/tr>\n<tr id='CatalogPath'><td> CatalogPath <\/td>       <td> The full path to the current catalog file.<\/td><\/tr>\n<tr id='OperatingSystem'><td> OperatingSystem <\/td>   <td> Either <span class='QO'>&#8220;<\/span>Windows<span class='QC'>&#8221;<\/span> or <span class='QO'>&#8220;<\/span>OS X<span class='QC'>&#8221;<\/span><\/td><\/tr>\n<tr id='OS'><td> OS <\/td>                <td> Either <span class='QO'>&#8220;<\/span>Win<span class='QC'>&#8221;<\/span> or <span class='QO'>&#8220;<\/span>Mac<span class='QC'>&#8221;<\/span><\/td><\/tr>\n\n<tr><td colspan='2'>Special<\/td><\/tr>\n\n<tr id='PluginProperty'><td> PluginProperty=<i style='font-size:85%'>field<\/i> <\/td> <td>Allows\nyou to access the per-image custom metadata kept by <span class='nobr'>a plugin,<\/span> where\n<i>field<\/i> is the plugin's id and the metadata field id, joined with <span class='nobr'>a\ndot.<\/span> For example,\n\n<center style='margin:10px 0;font-size:90%'>\n<tt class='token'>{PluginProperty=info.regex.lightroom.export.flickr2.url}<\/tt>\n<\/center>\n\nrefers to the <b>url<\/b> field of the plugin with id\n<b>info.regex.lightroom.export.flickr2<\/b> (<a\nhref='\/blog\/lightroom-goodies\/flickr' class='quiet'>my\nFlickr plugin<\/a>), and the result is the same as the <tt\nclass='token'>{FlickrUrl}<\/tt> token mentioned above. However, with <tt\nclass='token'>PluginProperty<\/tt>, you can reference any plugin data for\nwhich you know the plugin id and field name. <span class='nobr'>You can get<\/span> these from the\nplugin author, or try digging around the plugin's <b>Info.lua<\/b> for the\nplugin id and <span class='nobr'>a reference<\/span> to its <i>LrMetadataProvider<\/i>, where you can\nfind field ids.\n\n\n\n<\/td><\/tr>\n\n<tr id='Empty'><td> Empty <\/td>            <td>An empty string, perhaps useful for testing. Also, when placed between joining characters, it blocks their <a href=\"#joining\">squelching<\/a>.<\/td><\/tr>\n\n<tr><td> &#34; <i>text<\/i> &#34;<\/td>   <td>The text as provided. <span class='nobr'>It may not<\/span> contain the following characters: <b> { &nbsp; | &nbsp; } &nbsp; &#34;<\/b><\/td><\/tr>\n<tr id='Hyphen'><td>  Hyphen  <\/td>  <td>Inserts <span class='nobr'>a hyphen<\/span> that is never <a href=\"#joining\">squelched<\/a>.<\/td><\/tr>\n<tr id='Comma'><td>   Comma   <\/td>  <td>Inserts <span class='nobr'>a comma<\/span>  that is never <a href=\"#joining\">squelched<\/a>.<\/td><\/tr>\n<tr id='Space'><td>   Space   <\/td>  <td>Inserts <span class='nobr'>a space<\/span>  that is never <a href=\"#joining\">squelched<\/a>.<\/td><\/tr>\n<tr id='Newline'><td> Newline <\/td>                <td>Inserts <span class='nobr'>a newline<\/span> character that is never <a href=\"#joining\">squelched<\/a>; not all fields\/usages can properly handle <span class='nobr'>a newline<\/span> character, so take care.<\/td><\/tr>\n\n<tr><td> LUA <\/td>     <td>See the <a href='#lua'>section below<\/a> for details on this advanced, complex token.<\/td><\/tr>\n\n<tr id='Exiftool'><td> Exiftool=<i style='font-size:85%'>fieldcode<\/i> <\/td> <td>\n<p>(Currently available only in some plugins:\n<a href='\/blog\/lightroom-goodies\/bag-o-goodies'>Bag-o-Goodies<\/a>,\n<a href='\/blog\/lightroom-goodies\/collection-publisher'>Collection Publisher<\/a>,\nand\n<a href='\/blog\/lightroom-goodies\/folder-publisher'>Folder Publisher<\/a>)<\/p>\n\n<p>Inspects the master image file for the given <a href='http:\/\/owl.phy.queensu.ca\/~phil\/exiftool\/TagNames\/index.html'>Exiftool\nfield code<\/a>. <span class='nobr'>For this token<\/span> to work, the master image file must be available, of course.<\/p>\n\n<p>You can see the field codes for <span class='nobr'>a given<\/span> image file with\n<a href='\/blog\/lightroom-goodies\/metadata-viewer'>my Metadata Viewer plugin<\/a>,\nby toggling the <span class='QO'>&#8220;<\/span>show field<span class='QC'>&#8221;<\/span> control in the upper right from <span class='QO'>&#8220;<\/span>name<span class='QC'>&#8221;<\/span> to <span class='QO'>&#8220;<\/span>code<span class='QC'>&#8221;<\/span>.<\/p>\n\n<\/td><\/tr>\n\n<\/table>\n\n\n\n<h3 style='margin-top:50px'>Token Basics<\/h3>\n\n<p>As mentioned above, tokens are identified within <span class='nobr'>a template<\/span> by wrapping\nthem with <tt><b>{<\/b><\/tt> ... <tt><b>}<\/b><\/tt>. <span class='nobr'>The value<\/span> generated by\nthe token has leading and trailing spaces removed before being inserted\ninto the result. For example, if the <span class='QO'>&#8220;<\/span>Caption<span class='QC'>&#8221;<\/span> metadata item is\nthe string <span class='nowrap'><span class='QO'>&#8220;<\/span>My Vacation &nbsp;<span class='QC'>&#8221;<\/span><\/span>,\nthe value actually used for the <span class='token'>Caption<\/span> token\n(which appears as <span class='QO'>&#8220;<\/span><b class='token'>{Caption}<\/b><span class='QC'>&#8221;<\/span> in the\ntemplate) is <span class='nowrap'><span class='QO'>&#8220;<\/span>My Vacation<span class='QC'>&#8221;<\/span><\/span>.<\/p>\n\n<h3 id='optional' style='margin-top:50px'>Optional <span class='QO'>&#8220;<\/span>If Exists...<span class='QC'>&#8221;<\/span><\/h3>\n\n<p>You can have something depend on <span class='nobr'>a value<\/span> existing in the first place. For example, consider want to put\nquotes around the caption, as with:<\/p>\n\n<p style='margin-left:2em'><tt class='token'>The caption is <span class='QO'>&#8220;<\/span>{Caption}<span class='QC'>&#8221;<\/span><\/tt><\/p>\n\n<p>This produces pleasing results when the image has <span class='nobr'>a caption,<\/span> but if there is no caption, it produces the result:<\/p>\n\n<p style='margin-left:2em'><i>The caption is <span class='QO'>&#8220;<\/span><span class='QC'>&#8221;<\/span><\/i><\/p>\n\n<p>However, consider the following:<\/p>\n\n<p style='margin-left:2em'><tt class='token'>{Caption?The caption is <span class='QO'>&#8220;<\/span>{Caption}<span class='QC'>&#8221;<\/span>}<\/tt><\/p>\n\n<p>This uses a special token form:<\/p>\n\n<p style='margin-left:2em'><tt class='token'><b>{<\/b><\/tt> <i>token<\/i> <tt class='token'><b>?<\/b><\/tt>  <i style='background-color:black'>value to use if the named token is not empty<\/i> <tt class='token'><b>}<\/b><\/tt><\/p>\n\n<p>This produces nothing when there is no caption, but the desired <span class='QO'>&#8220;<\/span><i>The caption is...<\/i><span class='QC'>&#8221;<\/span> value when there is <span class='nobr'>a caption.<\/span><\/p>\n\n<p>Another example is <span class='QO'>&#8220;<\/span><span class='token'>{ISO?ISO{ISO}}<\/span><span class='QC'>&#8221;<\/span> which perhaps looks confusing. <span class='nobr'>It produces<\/span> nothing when\nthe image has no ISO sensor-sensitivity metadata, but text like <span class='QO'>&#8220;<\/span>ISO3200<span class='QC'>&#8221;<\/span> when it does. <span class='nobr'>The token<\/span> has three <span class='QO'>&#8220;<\/span>ISO<span class='QC'>&#8221;<\/span>\nin it:  the first is <span class='nobr'>a token<\/span> name, which, because it is followed by <span class='nobr'>a question<\/span> mark, means to ignore everything if the token has no value.\nThe second <span class='QO'>&#8220;<\/span>ISO<span class='QC'>&#8221;<\/span> is just text to include in the value, and that's followed immediately by the third <span class='QO'>&#8220;<\/span>ISO<span class='QC'>&#8221;<\/span>\nas <span class='QO'>&#8220;<\/span><span class='token'>{ISO}<\/span><span class='QC'>&#8221;<\/span>,\nwhich is <span class='nobr'>a straight<\/span>-up token to reference the ISO metadata value.<\/p>\n\n\n<h3 id='combining' style='margin-top:50px'>Combining Tokens<\/h3>\n\n<p>You may list multiple tokens within <tt><b>{<\/b><\/tt> ...\n<tt><b>}<\/b><\/tt>, separated by <tt><b>|<\/b><\/tt> (<span class='nobr'>a vertical<\/span> bar). <span class='nobr'>In such a<\/span> case, the first token that results in non-empty text is used. Tokens\nmay result in an empty value if the photo is missing the associated\nmetadata. For example, if <span class='nobr'>a photo<\/span> is missing the <span class='QO'>&#8220;<\/span>date taken<span class='QC'>&#8221;<\/span>\nmetadata, the <span class='token'>YYYY<\/span> token is empty. Thus, the\nprevious copyright example may be better written as:<\/p>\n\n<pre>\n     Copyright {YYYY|yyyy} {Artist}\n<\/pre>\n\n<p>In this case, if the <span class='token'>YYYY<\/span> token is empty, the\n<span class='token'>yyyy<\/span> token (the current year, which can never be\nempty) is used.<\/p>\n\n<p>Continuing with this example, because the <span\nclass='token'>Artist<\/span> token results in an empty item if there is no\nartist metadata, this example might be written as:<\/p>\n\n<pre>\n     Copyright {YYYY|yyyy} {Artist|&#34;by the photographer&#34;}\n<\/pre>\n\n<p>to become<\/p>\n\n<pre>\n     Copyright 2008 by the photographer\n<\/pre>\n\n<p>when there is no artist metadata.<\/p>\n\n<h3 style='margin-top:50px'><a name='filters'>Token Filters<\/a><\/h3>\n\n<p>Filters allow you to modify the text that <span class='nobr'>a token<\/span> generates. For\nnexample, applying the <span class='token'>S2U<\/span> filter (<span class='QO'>&#8220;<\/span>Space to\nUnderscore<span class='QC'>&#8221;<\/span>) to the <span class='QO'>&#8220;<\/span><b class='token'>Caption<\/b><span class='QC'>&#8221;<\/span> example\ngiven earlier results in <span class='nobr'>a value<\/span> of <span\nclass='nowrap'><span class='QO'>&#8220;<\/span>My<b>_<\/b>Vacation<span class='QC'>&#8221;<\/span><\/span>. <span class='nobr'>To indicate<\/span> that <span class='nobr'>a filter<\/span> should be applied to\n<span class='nobr'>a token,<\/span> append it to the token name with <span class='nobr'>a colon.<\/span>\nThis example appears would appear in <span class='nobr'>a template<\/span> as\n<span class='QO'>&#8220;<\/span><b class='token'>{Caption<b>:S2U<\/b>}<\/b><span class='QC'>&#8221;<\/span>.<\/p>\n\n<p>Token filters:<\/p>\n\n<table class='t' style='margin-left:2em; margin-right:2em' border='0' cellpadding='5' cellspacing='0'>\n\n<tr><td id='S2U'> S2U <\/td>      <td>Space to Underscore<\/td> <td>Any sequences of spaces (and\/or underscores) are replaced by <span class='nobr'>a single<\/span> underscore<\/td><\/tr>\n<tr><td id='S2D'> S2D <\/td>      <td>Space to Dash<\/td> <td>Any sequences of spaces (and\/or dashes) are replaced by <span class='nobr'>a single<\/span> dash<\/td><\/tr>\n\n<tr><td id='U2S'> U2S <\/td>      <td>Underscore to Space<\/td>      <td>Any sequences of underscores (and\/or spaces) are replaced by <span class='nobr'>a single<\/span> space<\/td><\/tr>\n<tr><td id='D2S'> D2S <\/td>      <td>Dash to Space<\/td>            <td>Any sequences of dashes (and\/or spaces) are replaced by <span class='nobr'>a single<\/span> space<\/td><\/tr>\n<tr><td id='DU2S'> DU2S <\/td>     <td>Dash\/Underscore to Space<\/td> <td>Any sequences of dashes, underscores, and\/or spaces are replaced by <span class='nobr'>a single<\/span> space<\/td><\/tr>\n\n<tr><td id='NS'> NS <\/td>     <td>No Spaces<\/td> <td>All spaces are removed<\/td><\/tr>\n<tr><td id='S2X'> S2X <\/td>    <td>Spaces to Nothing<\/td> <td>(synonym for the <b>NS<\/b> filter)<\/td><\/tr>\n<tr><td id='LO'> LO <\/td>     <td>Letters Only<\/td> <td>All spaces and punctuation are removed, leaving only letters (and numbers)<\/td><\/tr>\n\n\n<tr><td id='F2D'> F2D <\/td><td> Forward slash to Dash     <\/td><td> Forward-slash characters (&#8220;\/&#8221;) are replaced by dash characters (&#8220;-&#8221;) <\/td><\/tr>\n<tr><td id='F2S'> F2S <\/td><td> Forward slash to Space    <\/td><td> Forward-slash characters (&#8220;\/&#8221;) are replaced by space characters <\/td><\/tr>\n<tr><td id='F2X'> F2X <\/td><td> Forward slash to nothing  <\/td><td> Forward-slash characters (&#8220;\/&#8221;) are removed <\/td><\/tr>\n\n<tr><td id='B2D'> B2D <\/td><td> Backward slash to Dash      <\/td><td> Backward-slash characters (&#8220;\\&#8221;) are replaced by dash characters (&#8220;-&#8221;) <\/td><\/tr>\n<tr><td id='B2S'> B2S <\/td><td> Backward slash to Space     <\/td><td> Backward-slash characters (&#8220;\\&#8221;) are replaced by space characters <\/td><\/tr>\n<tr><td id='B2X'> B2X <\/td><td> Backward slash to nothing   <\/td><td> Backward-slash characters (&#8220;\\&#8221;) are removed <\/td><\/tr>\n\n<tr><td id='A2D'> A2D <\/td><td> Any slash to Dash      <\/td><td> Both kinds of slash characters are replaced by dash characters <\/td><\/tr>\n<tr><td id='A2S'> A2S <\/td><td> Any slash to Space     <\/td><td> Both kinds of slash characters are replaced by space characters <\/td><\/tr>\n<tr><td id='A2X'> A2X <\/td><td> Any slash to nothing  <\/td><td>  Both kinds of slash characters are removed <\/td><\/tr>\n\n<tr><td id='PF'>  PF <\/td><td> Plain Fractions <\/td><td> Converts the typographic fractions found in some metadata to plain ASCII, e.g. converts &#8220;\u00bd&#8221; to &#8220;1\/2&#8221; <\/td><\/tr>\n\n\n<tr><td> Places=<i>num<\/i> <\/td>   <td>specify numeric precision<\/td> <td>If the item is number, formats it to <i>num<\/i> decimal places. <span class='nobr'>If the item<\/span> is not <span class='nobr'>a number,<\/span> makes it empty.<\/td><\/tr>\n\n<tr><td> Length=<i>num<\/i> <\/td>   <td>specify max length<\/td> <td>If the item is longer than <i>num<\/i> characters long, it is truncated to the first <i>num<\/i> characters. Treats the text as UTF-8.<\/td><\/tr>\n\n<tr><td> After=<i>text<\/i> <\/td>     <td>Use value to the right of <i>text<\/i><\/td> <td><p>If the given <i>text<\/i> 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 <i>text<\/i> in the value.  If the <i>text<\/i> is not found in the value, the result of the token is empty.<\/p>\n\n<p>For example, if you tend to use captions like\n<span class='nowrap'><span class='QO'>&#8220;<\/span>My trip to Paris<span class='QC'>&#8221;<\/span><\/span>\nand\n<span class='nowrap'><span class='QO'>&#8220;<\/span>My trip to the Canadian Rockies<span class='QC'>&#8221;<\/span><\/span>,\nand you wanted shorter text, you might consider using\n<span class='token'>{Caption:After=trip to}<\/span> to result in values like\n<span class='nowrap'><span class='QO'>&#8220;<\/span>Paris<span class='QC'>&#8221;<\/span><\/span>\nand\n<span class='nowrap'><span class='QO'>&#8220;<\/span>the Canadian Rockies<span class='QC'>&#8221;<\/span><\/span>.<\/p>\n\n<p>If you wanted to implement an idea such as \"<i>Strip the '...trip to' text from the caption if it's there, and use the unadulterated caption if not<\/i>\",\nyou would append an unadorned <span class='token'>Caption<\/span> token as described in the <span class='QO'>&#8220;<\/span>Combining Tokens<span class='QC'>&#8221;<\/span> section above, resulting in\n<span class='token'>{Caption:After=trip to|Caption}<\/span>.<\/p>\n\n<\/td><\/tr>\n\n\n<tr><td> UC <\/td>      <td>Upper Case<\/td> <td>Capitalizes the item<\/td><\/tr>\n\n<tr><td> UCFirst <\/td> <td>Upper Case <span class='nobr'>(first character)<\/span><\/td> <td>Capitalizes the first character of the item.<\/td><\/tr>\n\n<tr><td> UCWords <\/td> <td>Upper Case Words<\/td> <td>Capitalizes the first character of the item, and any character after <span class='nobr'>a space<\/span> or hyphen.<\/td><\/tr>\n\n<tr><td> LC <\/td>      <td>Lower Case<\/td> <td>Ensures the item is all lower case.<\/td><\/tr>\n\n<tr><td> LCFirst <\/td> <td>Lower Case <span class='nobr'>(first character)<\/span><\/td> <td>Lowers the case of the first character of the item.<\/td><\/tr>\n\n<tr><td> EMBED <\/td> <td>Embed value and reparse<\/td><td><p> When used in the <span class='QO'>&#8220;<\/span>additional keywords<span class='QC'>&#8221;<\/span> section of an uploader plugin, causes the token to <i>not<\/i> be treated as <span class='nobr'>a single<\/span> unit, but subject to one more level of inspection.<\/p>\n\n<p>For example, if your <b>title<\/b> metadata field has <span class='nobr'><span class='QO'>&#8220;<\/span><tt>one two three<\/tt><span class='QC'>&#8221;<\/span><\/span> (without quotes) and in the <span class='QO'>&#8220;<\/span>additional keywords<span class='QC'>&#8221;<\/span> field you put\n<span class='nobr'><span class='QO'>&#8220;<\/span><tt>{Title}<\/tt><span class='QC'>&#8221;<\/span><\/span>, the result is one additional keyword:\n<span class='nobr'><span class='QO'>&#8220;<\/span><tt>one two three<\/tt><span class='QC'>&#8221;<\/span><\/span>.  However, if you use\n<span class='nobr'><span class='QO'>&#8220;<\/span><tt>{Title:EMBED}<\/tt><span class='QC'>&#8221;<\/span><\/span>, the result is three keywords:\n<span class='nobr'><span class='QO'>&#8220;<\/span><tt>one<\/tt><span class='QC'>&#8221;<\/span><\/span>,\n<span class='nobr'><span class='QO'>&#8220;<\/span><tt>two<\/tt><span class='QC'>&#8221;<\/span><\/span>, and\n<span class='nobr'><span class='QO'>&#8220;<\/span><tt>three<\/tt><span class='QC'>&#8221;<\/span><\/span>.<\/p>\n\n<\/td><\/tr>\n\n<tr><td> evenIfPrivate <\/td> <td><\/td> <td> Forcefully reference <span class='nobr'>a location<\/span>-related value, even if other privacy-related settings would have excluded it. E.g.\neven though <span class='nobr'>a photo<\/span> is geoencoded, <tt>{GPSCoords}<\/tt> might be blank if privacy settings elsewhere indicate that the location should not be shared; but even in that case,  <tt>{GPSCoords:evenIfPrivate}<\/tt> would show the location.\n<\/td><\/tr>\n\n<\/table>\n\n<h3 style='margin-top:50px' id='joining'>Squelching Superfluous Joining Characters<\/h3>\n\n<p style='margin-bottom:5px'>Within <span class='nobr'>a template,<\/span> <i>joining characters<\/i> are special:<\/p>\n<ul style='margin-top:5px'>\n  <li>space<\/li>\n  <li>comma<\/li>\n  <li>hyphen\/minus<\/li>\n  <li>colon<\/li>\n  <li>the <span style='font-family:courier'>&lt;br&gt;<\/span> and <span style='font-family:courier'>&lt;br\/&gt;<\/span> sequences<\/li>\n<\/ul>\n\n<p>After a photo-specific value has been computed from <span class='nobr'>a template,<\/span> all\nleading and trailing joining characters are removed, and embedded\nrepetitions are replaced by <span class='nobr'>a single<\/span> item.<\/p>\n\n<p>As an example of the first case, consider<\/p>\n\n<pre>\n     Copyright {YYYY|yyyy} {Artist}\n<\/pre>\n\n<p>when there is no artist metadata. Without these special rules, this\nwould result in the derived value having trailing space, but the special\nsquelching rules remove it.<\/p>\n\n<p>As another example, consider the template:<\/p>\n\n<pre>\n     {Location}-{Country}-{State}-{City}-{Caption}\n<\/pre>\n\n<p>for a photo that has <span class='QO'>&#8220;<\/span>Location<span class='QC'>&#8221;<\/span> and <span class='QO'>&#8220;<\/span>Caption<span class='QC'>&#8221;<\/span>,\nbut no <span class='QO'>&#8220;<\/span>Country,<span class='QC'>&#8221;<\/span> <span class='QO'>&#8220;<\/span>City,<span class='QC'>&#8221;<\/span> or <span class='QO'>&#8220;<\/span>State<span class='QC'>&#8221;<\/span>.\nAssuming that location and caption are <span class='QO'>&#8220;<\/span>Home<span class='QC'>&#8221;<\/span> and\n<span class='QO'>&#8220;<\/span>Having Fun<span class='QC'>&#8221;<\/span> respectively, it becomes:<\/p>\n\n<pre>\n     Home-Having Fun\n<\/pre>\n\n<p>which is better than it would be without these special rules:<\/p>\n\n<pre>\n     Home----Having Fun\n<\/pre>\n\n<p>Note that space, comma, and hyphen\/minus are only special when they're\npart of the template itself. When they are part of the value derived\nfrom <span class='nobr'>a token<\/span> (such as the space in <span class='QO'>&#8220;<\/span>Having Fun<span class='QC'>&#8221;<\/span> above), they\nare never considered for squelching.<\/p>\n\n<p>As such, you can use either <span class='token'>{-}<\/span> or <span\nclass='token'>{&#34;-&#34;}<\/span> to include <span class='nobr'>a hyphen<\/span>\/minus that will never be\nsquelched. Similarly, you can use <span class='token'>{,}<\/span> or <span\nclass='token'>{&#34;,&#34;}<\/span> for <span class='nobr'>a comma.<\/span><\/p>\n\n<h4 style='margin-top:50px' id='empty'>The special <tt>{Empty}<\/tt> token<\/h4>\n\n<p>The <tt>{Empty}<\/tt> token produces no text, but has the side effect in\nthat it interrupts the squelching of joining characters. Without it, the\nsequence\n\n  <span class='nobr'><span class='QO'>&#8220;<\/span><b>&lt;br&gt;&lt;br&gt;<\/b><span class='QC'>&#8221;<\/span><\/span>\n\nbecomes\n\n  <span class='nobr'><span class='QO'>&#8220;<\/span><b>&lt;br&gt;<\/b><span class='QC'>&#8221;<\/span><\/span>\n\nbut with it,\n\n  <span class='nobr'><span class='QO'>&#8220;<\/span><b>&lt;br&gt;{EMPTY}&lt;br&gt;<\/b><span class='QC'>&#8221;<\/span><\/span>\n\nbecomes\n\n  <span class='nobr'><span class='QO'>&#8220;<\/span><b>&lt;br&gt;&lt;br&gt;<\/b><span class='QC'>&#8221;<\/span>.<\/span><\/p>\n\n<h4 style='margin-top:50px' id='nojoiners'>The special <tt>{NOJOINERS}<\/tt> token<\/h4>\n\n<p>As mentioned above, leading and trailing joining characters are\nstripped, but sometimes you want them stripped whenever they appear in <span class='nobr'>a\ncertain<\/span> context. For example, the template<\/p>\n\n<pre>\n     &lt;span class='where'&gt;{City}, {State}&lt;\/span&gt;\n<\/pre>\n\n<p>results in something like <span class='QO'>&#8220;<\/span><tt><b>&lt;span class='where'&gt;Paris,\n&lt;\/span&gt;<\/b><\/tt><span class='QC'>&#8221;<\/span> if <b>City<\/b> is <span class='QO'>&#8220;<\/span>Paris<span class='QC'>&#8221;<\/span> but\n<b>State<\/b> has no value. <span class='nobr'>In this case<\/span> you'd like to mark the start and end of\nthe <tt>&lt;span&gt;<\/tt> as being places where no joining characters\nshould accumulate, just as they shouldn't accumulate at the start and end\nof the whole specification.<\/p>\n\n<p>To do this, put the special <tt>{NOJOINERS}<\/tt> token in these spots, e.g.<\/p>\n\n<pre>\n     &lt;span class='where'&gt;<b>{NOJOINERS}<\/b>{City}, {State}<b>{NOJOINERS}<\/b>&lt;\/span&gt;\n<\/pre>\n\n<p style='margin-top:30px'>The exact rules for how joining characters are squelched are complex,\nbut they are designed to produce <span class='nobr'>a common<\/span>-sense result. <span class='nobr'>If you run<\/span> into one\nthat doesn't work as you'd like, let me know.<\/p>\n\n\n\n\n\n<h3 style='margin-top:50px' id='lua'>The Special <tt>{LUA=...}<\/tt> Token<\/h3>\n\n<p>This advanced programming-like feature allows you to execute arbitrary <a href='http:\/\/www.lua.org\/'>Lua<\/a> code, in\nan environment where the tokens above have been prepopulated into variables. For example,<\/p>\n\n<pre class='token' style='font-size:90%; margin-left:2em'>\n   {LUA=CreatorPhone}\n<\/pre>\n\n<p>and<\/p>\n\n<pre class='token' style='font-size:90%; margin-left:2em'>\n   {LUA=return CreatorPhone}\n<\/pre>\n\n<p>are exactly the same as the <span class='token'>{CreatorPhone}<\/span> token, but, for example<\/p>\n\n<pre class='token' style='font-size:90%; margin-left:2em'>\n   {LUA=  if  CreatorPhone ~= ''  then    return sprintf(\"Contact: %s\", CreatorPhone)  end  }\n<\/pre>\n\n<p>becomes the string <span class='QO'>&#8220;<\/span><b>Contact: <i>text-from-CreatorPhone<\/i><\/b><span class='QC'>&#8221;<\/span> if the <span class='token'>CreatorPhone<\/span>\ntoken is not empty, nothing if it is.<\/p>\n\n<p>The special Lua environment, in the latest version of plugins running in the latest version of Lightroom, includes:<\/p>\n\n<ul>\n  <li><p>Variables exist for almost all of the tokens (except <span\nclass='token'>DaysSince<\/span>, <span class='token'>IfGeoencoded<\/span>, etc. &mdash; tokens that require an extra\nargument). Each one is <span class='nobr'>a string<\/span>; if the token has no value, its variable in the special Lua environment is the empty\nstring <b><tt>''<\/tt><\/b>.<\/p><\/li>\n\n<li><p>The Boolean <b>locationIsPrivate<\/b>, which is <b>true<\/b> if the photo is geoencoded and its location is within an area marked <span class='QO'>&#8220;<\/span>private<span class='QC'>&#8221;<\/span> in the Map Module, <b>false<\/b> otherwise. (Always <b>false<\/b> prior to Lr4.1.)<\/p><\/li>\n\n<li><p>The standard Lua functions <b>tonumber()<\/b>, <b>tostring()<\/b>, <b>type()<\/b>, <b>unpack()<\/b>,\n<b>ipairs()<\/b>, and <b>pairs()<\/b>.<\/p><\/li>\n\n<li><p>The standard Lua name spaces <b>string<\/b>, <b>table<\/b>, and <b>math<\/b>. The <b>os<\/b> namespace is partially included:\n    <b>os.date()<\/b>, <b>os.time()<\/b>, and <b>os.tmpname()<\/b>.<\/p><\/li>\n\n<li><p>The Lightroom SDK namespaces\n<b>LrDate<\/b>,\n<b>LrLocalization<\/b>,\n<b>LrMath<\/b>,\n<b>LrMD5<\/b>,\n<b>LrPathUtils<\/b>,\n<b>LrStringUtils<\/b>, and\n<b>LrSystemInfo<\/b>.\n<span class='nobr'>SDK docs can<\/span> be downloaded <a href='http:\/\/www.adobe.com\/devnet\/photoshoplightroom.html'>here<\/a>.<\/p><\/li>\n\n<li><p>The Booleans <b>WIN<\/b> and <b>MAC<\/b>, which indicate\nthe type of host operating system, and <b>sprintf()<\/b>, which is <span class='nobr'>a synonym<\/span>\nfor <b>string.format()<\/b>.<\/p><\/li>\n\n<li><p>The function <b>TBL(...)<\/b>, which returns <span class='nobr'>a new<\/span> table, populating it with any arguments provided. This is to help avoid curly braces in inlined Lua.<\/p><\/li>\n\n     <li><p>The function <b>ne(<i>item<\/i>)<\/b>, meaning <span class='QO'>&#8220;<\/span>non-empty<span class='QC'>&#8221;<\/span>. It returns <b>nil<\/b> if the <i>item<\/i> is <b>nil<\/b> or <b>tostring(<i>item<\/i>)<\/b> evaluates to <span class='nobr'>a zero<\/span>-length string.<\/p><\/li>\n\n     <li><p>The function <b>nb(<i>item<\/i>)<\/b>, meaning <span class='QO'>&#8220;<\/span>non-blank<span class='QC'>&#8221;<\/span>. It returns <b>nil<\/b> if the <i>item<\/i> is <b>nil<\/b> or <b>tostring(<i>item<\/i>)<\/b> evaluates to <span class='nobr'>a string<\/span> that has no non-whitespace characters.<\/p><\/li>\n\n     <li><p>The function <b>uc(<i>item<\/i>)<\/b>, which gives the upper-case version of whatever is passed to it. There's also <b>ucFirst(<i>item<\/i>)<\/b>, which uppercases only the first character, and the lowercase versions <b>lc(<i>item<\/i>)<\/b> and <b>lcFirst(<i>item<\/i>)<\/b>.<\/p><\/li>\n\n     <li><p>The variable <b>photoTime<\/b>, which returns the Cocoa timestamp of the photo in question, if any.  This is suitable for passing to Lightroom's\n          <tt>LrDate.timestampToComponents()<\/tt> and <tt>LrDate.timeToUserFormat()<\/tt> functions, among others. <span class='nobr'>Add 978307200<\/span> to get <span class='nobr'>a Unix<\/span> Time.<\/p><\/li>\n\n     <li><p>The variable <b>currentTime<\/b>, which returns the current Cocoa timestamp; identical to <b>LrDate.currentTime()<\/b>.<\/p><\/li>\n\n<li><p>The function <b>date_diff()<\/b>, which returns <span class='nobr'>a string<\/span> indicating the number of years\/months\/days separating its two arguments.\nEach argument can be <span class='nobr'>a Cocoa<\/span> timestamp like the <b>photoTime<\/b> or <b>currentTime<\/b> variables above, <span class='nobr'>a string<\/span> in the form <span class='QO'>&#8220;<\/span>YYYY-MM-DD<span class='QC'>&#8221;<\/span>,\nor <span class='nobr'>a table<\/span> of numbers: <tt>{year, month, date, hour, minute, second}<\/tt>. The hour\/minute\/second are optional.<\/p>\n\n<p>For example, the following might be used to indicate the age of <span class='nobr'>a child<\/span> (born on <span class='nobr'>October 22,<\/span> 2009) as of the photo date:\n<span class='token nobr'>{LUA= &#34;Aged &#34; .. date_diff(&#34;2009-10-22&#34;, photoTime)}<\/span>. <span class='nobr'>For a photo<\/span> taken Jan 1, 2013 it returns the string\n<span class='nobr'><span class='QO'>&#8220;<\/span><i>Aged 3 years, 2 months, 10 days<\/i><span class='QC'>&#8221;<\/span> on an English system.<\/span><\/p>\n\n<p>This does exactly the same thing: <span class='token nobr'>{LUA= &#34;Aged &#34; .. date_diff({2009,10,22}, photoTime)}<\/span><\/p>\n\n<p>There's actually a third argument to <b>date_diff()<\/b> that indicates <span class='nobr'>a timezone<\/span> in which to interpret dates provided via string or table like the two examples above. <span class='nobr'>The default<\/span> is the current timezone of the computer. <span class='nobr'>If you provide<\/span> <span class='nobr'>a timezone,<\/span> it should be as <span class='nobr'>a number<\/span> of seconds east of UTC.<\/p><\/li>\n\n<li id='KW'><p>A table <b>KW<\/b> that has keys for every keyword applied to the photo (the values are <i>true<\/i>),\nand <span class='nobr'>a similar<\/span> table <b>KWE<\/b> with keys for exported keywords. Thus, the code snippet <b>KW.private<\/b> is <b>true<\/b>\nif the keyword <span class='QO'>&#8220;<\/span>private<span class='QC'>&#8221;<\/span> has been applied to the photo, <b>nil<\/b> otherwise.<\/p><\/li>\n\n\n<li id='KWf'><p>The function <b>KWf()<\/b> &mdash; the name comes from <i>KeyWord formatting<\/i> &mdash; that does something with each keyword marked for export.\nCalled in the form <span class='token nobr'>KWf(<i>format<\/i>,&nbsp;<i>joiner<\/i>)<\/span>, the first argument\nis text; within that text, the sequence <span class='QO'>&#8220;<\/span><tt>%s<\/tt><span class='QC'>&#8221;<\/span> is replaced by <span class='nobr'>a keyword.<\/span> After all such replacements, they're all joined together by the <i>joiner<\/i> text.<\/p>\n\n<p>For example, <span class='token nobr'>KWf(&#34;[%s]&#34;, &#34; -- &#34;)<\/span> might result in\n\n<span class='nobr'><span class='QO'>&#8220;<\/span>[Paris] -- [landmark] -- [tower]<span class='QC'>&#8221;<\/span><\/span>,\n\nand <span class='token nobr'>KWf(&#34;%s&#34;, &#34;|&#34;)<\/span> might result in\n\n<span class='nobr'><span class='QO'>&#8220;<\/span>Paris|landmark|tower<span class='QC'>&#8221;<\/span><\/span>.\n\n<\/p><\/li>\n\n\n<li id='CN'><p>A table <b>CN<\/b> that has keys for every <b>C<\/b>ollection <b>N<\/b>ame that the photo is\nincluded in (the values are <i>true<\/i>). Smart collections and publish collections are not considered.\nComparable to <a href='#CollectionNames'>the <span class='token'>{CollectionNames}<\/span> token<\/a>.\n<\/p><\/li>\n\n<li id='CNf'><p>The function <b>CNf()<\/b> for <b>C<\/b>ollection <b>N<\/b>ame <b>f<\/b>ormatting. Used exactly\nlike <a href='#KWf'>the <b>KWf()<\/b> function<\/a>, but works with items in <a href='#CN'>the <b>CN<\/b> table<\/a>.<\/p><\/li>\n\n<li id='CFN'><p>A table <b>CFN<\/b> that has keys for every <b>C<\/b>ollection <b>F<\/b>ull <b>N<\/b>ame that the photo is\nincluded in (the values are <i>true<\/i>). Smart collections and publish collections are not considered.\nSee <a href='#CollectionFullNames'>the <span class='token'>{CollectionFullNames}<\/span> token<\/a> for more info.\n<\/p><\/li>\n\n<li id='CFNf'><p>The function <b>CFNf()<\/b> for <b>C<\/b>ollection <b>F<\/b>ull <b>N<\/b>ame <b>f<\/b>ormatting. Used exactly\nlike <a href='#KWf'>the <b>KWf()<\/b> function<\/a>, but works with items in <a href='#CFN'>the <b>CFN<\/b> table<\/a>.<\/p><\/li>\n\n<li id='PCH'><p>A table <b>PCH<\/b>, short for\n<span class='QO'>&#8220;<\/span><b>P<\/b>ublish <b>C<\/b>ollection <b>H<\/b>ierarchy<span class='QC'>&#8221;<\/span>, that contains information about the current publish operation. (The table is empty except during publish operations.)<\/p>\n\n<p>If, for example, within a publish service you have <span class='nobr'>a publish<\/span> collection set named <span class='QO'>&#8220;<\/span>Travel<span class='QC'>&#8221;<\/span>, and within that another set named <span class='QO'>&#8220;<\/span>Asia<span class='QC'>&#8221;<\/span>, and within that, the final collection is <span class='QO'>&#8220;<\/span>Japan<span class='QC'>&#8221;<\/span>, then during publish of <span class='QO'>&#8220;<\/span>Japan<span class='QC'>&#8221;<\/span> the <b>PCH<\/b> table contains\nthree strings: <tt>{ <span class='QO'>&#8220;<\/span>Travel<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>Asia<span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span>Japan<span class='QC'>&#8221;<\/span> }<\/tt><\/p>\n<\/li>\n\n\n<li><p>The function <b>load()<\/b>, which executes Lua code in <span class='nobr'>a named<\/span> file, as <a href='#lua-load'>discussed below<\/a>.<\/p><\/li>\n\n<li><p id='PP'>The special <b>PP(<i>id<\/i>)<\/b> pseudo-function that returns the value of the photo's Plugin Property named by the\n<i>id<\/i>. For example, <tt class='nobr'>PP('info.regex.lightroom.gps.Speed')<\/tt> is the same as the <a href='#SpeedKPH'><span\nclass='token'>{SpeedKPH}<\/span><\/a> token. <span class='nobr'>Due to esoteric<\/span> technical limitations in Lightroom, this is\nnot actually implemented as <span class='nobr'>a Lua<\/span> function, but rather it's pre-detected in the Lua snippet and has its\nvalue substituted in place, prior to the Lua snippet being interpreted as Lua code. As such, it's not available within <span\nclass='nobr'>a file<\/span> imported via <b>load()<\/b>, so if you want to use it within such <span class='nobr'>a file,<\/span> you\nhave to cache the value in <span class='nobr'>a variable<\/span> prior to the <b>load()<\/b>.<\/p><\/li>\n\n<li><p id='PEOPLE'>The table <b>PEOPLE<\/b>, which includes one entry per person tagged in the photo. Each entry is <span class='nobr'>a table<\/span> with\nfields <b>name<\/b>, <b>nickname<\/b>, <b>bday<\/b> (Coco timestamp of their birthday, or <tt>nil<\/tt> if not known), <b>ts<\/b>\n(Coco timestamp of their birthday, or the current timestamp if not known), and <b>keyword<\/b> (the LrKeyword object). Most fields will\nbe empty if the person keywords has not been registered via <a href='\/blog\/lightroom-goodies\/people-support'>my People Support<\/a> plugin.<\/p><\/li>\n\n<\/ul>\n\n\n<p>Here are some examples. Some have been broken into multiple lines for display, with pretty indenting, for easier\nreading one this page; when inputting into the plugin, you'll have to put it all on one big long (ugly) line....<\/p>\n\n<ul>\n\n  <li><p><span  style='font-size:small' class='token nobr'>{LUA=if Artist ~= &#34;&#34; then return sprintf(&#34;Copyright %s&#34;, Artist)  end}<\/span>\n  <br\/>\n    Becomes <span class='QO'>&#8220;<\/span>Copyright ....<span class='QC'>&#8221;<\/span> with the name of the <span class='token'>Artist<\/span> if there is an\n    <span class='token'>Artist<\/span> token.\n  <\/p><\/li>\n\n\n\n  <li><p><span  style='font-size:small' class='token nobr'>{LUA=if Artist ~= &#34;&#34; and Copyright = &#34;&#34; then return sprintf(&#34;Copyright %s&#34;, Artist)  end}<\/span>\n  <br\/>\n    Like the one above, but only if there is no <span class='token'>Copyright<\/span> token.\n  <\/p><\/li>\n\n\n\n  <li><p><span  style='font-size:small' class='token nobr'>{LUA=if Artist ~= &#34;&#34; then return sprintf(&#34;Copyright %s %s&#34;, yyyy, Artist)  end}<\/span>\n  <br\/>\n    Becomes &#34;Copyright #### ....&#34; with the current year and the name of the <span class='token'>Artist<\/span>,\n    if there is an <span class='token'>Artist<\/span> token.\n  <\/p><\/li>\n\n\n\n  <li><p><span  style='font-size:small' class='token nobr'>{LUA=if Artist ~= &#34;&#34; then<br\/>&nbsp;&nbsp;&nbsp;if yyyy == YYYY or YYYY == &#34;&#34; then<br\/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return sprintf(&#34;Copyright %s %s&#34;, yyyy, Artist)<br\/>&nbsp;&nbsp;&nbsp;else<br\/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return sprintf(&#34;Copyright %s-%s %s&#34;, YYYY, yyyy, Artist)<br\/>&nbsp;&nbsp;&nbsp;end<br\/>end}<\/span>\n  <br\/>\n\n    Like the one above, but the reference to the year in the copyright statement becomes <span class='nobr'>a range<\/span> if the photo has <span class='nobr'>a date<\/span>\n    associated with it and that date is not the current year,\n    <span class='nobr'>e.g. &#34;Copyright 2006-2010 Jeffrey Friedl&#34;<\/span> for <span class='nobr'>a photo<\/span> taken in 2006 and being processed\n    in 2010.\n  <\/p><\/li>\n\n\n\n   <li><p><span  style='font-size:small' class='token\nnobr'>{LUA=if Artist ~= &#34;&#34; then<br\/>&nbsp;&nbsp;&nbsp;when = YYYY==yyyy or YYYY==&#34;&#34; and yyyy or YYYY..&#34;-&#34;..yyyy<br\/>&nbsp;&nbsp;&nbsp;return sprintf(&#34;Copyright %s %s&#34;, when, Artist)<br\/>end}<\/span>\n  <br\/>\n    Exactly like the one just above.\n  <\/p><\/li>\n\n\n  <li><p><span style='font-size:small' class='token\n    nobr'>{LUA=if GPSCoordinates ~= &#34;&#34; then return sprintf(&#34;geo:lat=%s;geo:lon=%s&#34;, Latitude, Longitude) end}<\/span>\n  <br\/>\n  If the photo is geoencoded, becomes GPS machine tags.\n  <\/p><\/li>\n\n\n\n  <li><p><span style='font-size:small'  class='token nobr'>{LUA=if KW.private and not KWE.private then return &#34;private, but not reporting as such&#34; end}<\/span>\n  <br\/>\n  Becomes <span class='QO'>&#8220;<\/span>private, but not reporting as such<span class='QC'>&#8221;<\/span> if marked with the keyword <span class='QO'>&#8220;<\/span>private<span class='QC'>&#8221;<\/span>, but that keyword is not marked for export.\n  <\/p><\/li>\n\n\n\n\n<\/ul>\n\n<p id='lua-load'><b>Loading From <span class='nobr'>a File<\/span><\/b><\/p>\n\n<p>In Lightroom 3 and later, the <b>load()<\/b> function loads Lua code from <span class='nobr'>a file.<\/span> <span class='nobr'>You can load<\/span> <span class='nobr'>a library<\/span> of routines and then make reference to\nthe routines later in the <tt class='token'>{LUA= ... }<\/tt>, or you can simply return the value of <b>load()<\/b>, which is the value returned at the end of the file:<\/p>\n\n<pre class='token'>\n   {LUA= return load(\"\/full\/path\/to\/your\/lua\/file.lua\") }\n<\/pre>\n\n<p>This allows you to keep the tokens that appear in little plugin fields more manageable, yet lets you easily access arbitrarily-complex logic.<\/p>\n\n\n<p id='real-example'><b>Real-World <tt>{LUA}<\/tt> Example<\/b><\/p>\n\n<p>As one example, in my <a href='\/blog\/lightroom-goodies\/picasaweb'>PicasaWeb<\/a> (Google Plus, sort of) publish service for my\n<a href='https:\/\/plus.google.com\/u\/0\/photos\/110839411749298049815\/albums\/5831815186739038721'><span class='QO'>&#8220;<\/span>Selected Blog Photos<span class='QC'>&#8221;<\/span> gallery<\/a> on G+, <span class='nobr'>I want the<\/span> image\ncaption 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. <span class='nobr'>To do this<\/span>, <span class='nobr'>I created<\/span> <span class='nobr'>a file<\/span> (<span class='QO'>&#8220;<\/span>PicasaWeb.lua<span class='QC'>&#8221;<\/span>) with this contents:<\/p>\n<pre style='font-size:85%; padding-left:1em; margin-left:1em; border-left: solid 4px #444'>\n\nlocal Month = { \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" }\n\nfunction comment()\n   if not JobIdentifier then\n      return \"\"\n   end\n\n   --\n   -- JobIdentifier should have one or more urls like \"https:\/\/regex.info\/blog\/2012-06-09\/2015\"\n   --\n   -- Grab the date from the final one\n   --\n   local url = JobIdentifier:match(\".*(http:\/\/%S+)\")\n   if not url then\n      return \"\"\n   end\n\n   local Yx,Mx,Dx = url:match(\".*blog\/(20%d%d)%-(%d%d)-(%d%d)\/\")\n   if not Dx then\n      return \"\"\n   end\n   local rows = {\n      sprintf(\"This photo appeared in an article on my blog on %s %d, %s.\", Month[tonumber(Mx)], tonumber(Dx), Yx),\n      sprintf(\"\u3053\u306e\u5199\u771f\u306f%d\u6708%d\u65e5\u30d6\u30ed\u30b0\u306e\u8a18\u4e8b\u306b\u8f09\u308a\u307e\u3057\u305f\u3002\",                     tonumber(Mx),  tonumber(Dx))\n   }\n   if Headline then\n      table.insert(rows, sprintf('\"%s\"', Headline))\n   end\n   table.insert(rows, url)\n\n   return table.concat(rows, \"\\n\")\nend\n\nreturn comment()\n\n<\/pre>\n\n<p>and access it from a Caption preset in the plugin with this template token:<\/p>\n\n<pre style='padding-left:2em'>\n{LUA= load(\"\/Users\/jfriedl\/Dropbox\/Lightroom\/LuaStuff\/PicasaWeb.lua\")}\n<\/pre>\n\n<!--\n<p>As another example, in <span class='nobr'>a publish<\/span> service with <a href='\/blog\/lightroom-goodies\/zenfolio'>my Zenfolio plugin<\/a>, <span class='nobr'>I keep a<\/span> copy of some\nphotos in <span class='nobr'>a special<\/span> archive hierarchy (sort of similar to what <span class='nobr'>I did<\/span> years ago in <a href='\/blog\/2008-10-06\/956'>here<\/a>)\n-->\n\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p> <p>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.<\/p> <p>A template is a combination of prose and special tokens wrapped in [...]","protected":false},"author":1,"featured_media":0,"parent":864,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/799"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/comments?post=799"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/799\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/864"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}