How to use Caption Builder
Anyone want to try a new feature that’s coming in my Search and Replace plugin? Update: If so, it’s now in the current version of the plugin, updated November 2016.
The new feature is called “caption builder” and I hope its purpose is obvious – you can build up captions from other metadata fields and and external lists eg for shirt numbers or other mnemonic. You’d use an expression like “Scene in {stateProvince} with {title}, copyright {copyright}” or you’d type in [23] and the plugin would read David Beckham or Michael Jordan from a comma or tab-separated text file.
It is not intended for everyone, just people who want to build up captions from other metadata and external lists. For more background, see Jonathan Pow’s article Lightroom Caption Builder for Photojournalists, Sports Photographers and Stock Photographers for a practical example (PDF version PDF version.
John,
I’ve used Search Replace Transfer in LR alongside PM for years and somehow only recently discovered the Caption Builder feature. Just what I was missing in Lightroom!
If you are taking suggestions, first, the ability to target fields other than caption (of course, it is possible to Build a compound field in Caption, Transfer it to the other target field field, then Build the caption itself).
And it would be great to have an option (i.e. a checkbox) that would prevent the blank lines that come from “stuff|{field(s) that are empty}|other stuff”.
Finally, I noticed that the IPTC Event field doesn’t seem to be available in the pulldown field lists, but I tried {event} and it worked. . THe excellent preview of the built-up caption makes this very easy!
Thanks for the fantastic tool,
Don
Hi John,
I was wondering how you manage to get your metadata for location (eg city, country etc) filled in. For me, I use Lightroom’s address lookup but the locations are “greyed out” so it seems like the plugin does not recognise values that are “greyed out”/”not saved”.
Sadly Adobe don’t let plugins access those “reverse geocoded” (automatically-entered) locations, which is why they don’t appear in my plugin.
One solution may be to use Jeffrey Friedl’s Geoencoding Support plugin http://regex.info/blog/lightroom-goodies/gps which does reverse geocoding but enters the location values.
What I do is enter the locations manually. That’s because most of my photography is in the UK and reverse geocoding is too legalistic for me. For example, I want the country to be England/Scotland/Wales, but reverse geocoding says the country is UK.
Hi John,
I struggle not to have “Unknown *” added in the keywords when I do an Audit and when an IPCT Location field is empty. Is there a way to do nothing when nothing is written in a field? To me, Sublocation is always empty in my IPTC, and sometimes, City also for photos taken in the steppe or in the desert for example.
Second question: how not to create an IPTC location hierarchy? I already have one (per continent) and your system is therefore not adequate (it start with country). So I want to avoid messing up my keyword database and would like the plugin not to create a new one. How do you do that?
Thank you in advance for your help,
Camille
Hi John – I’m on version 1.48 of Search and Replace. Was looking to get the caption builder added but from what I can see this is in later version. But when I check for updates or go the S&R web page (http://photographers-toolbox.com/products/jbeardsworth/findreplace/) it’s showing the latest version as 1.48
Am I missing something ?
Tim
I normally create caption with
{descriptionWriter}|{headline}|{location}, {city}|{stateProvince}, {country}
but annoying feature in this is that sometimes field are missing so I got empty lines and extra commas.
It would be a nice feature if these separator characters are added only if neighbouring fields are not empty.
Thanks for the idea – it makes sense and I’ll see if I can add it.
What am I missing, In the photo of your caption builder there is a “write to caption field” button, I do not have this button in my window, how do I write the caption? If I just click the close button the fields have not been changed.
Plug-in error log for plug-in at: C:\Lightroom Plug-ins\findreplace.lrplugin
**** Error 1
An unknown error occurred.
func_favourites.lua:39: attempt to index field ‘source_target_combo’ (a nil value) (inside the callback for addObserver for condition recall)
What version of LR, what OS, and what were you doing when it happened? Also in Plugin Manager is a Reset button which gets out of tricky situations.
Lightroom 2015.8 Release and OS is Windows 8.1. What i was doing was trying the build a caption, and since there was no button other close i clicked the close button.
That’s a bug – download again and it should be there in version 1.58.8.6.
Thank you!
Jonathan Pow’s article shows IPTC and/or EXIF values that aren’t listed in your pick lists and that still work. Is there a cheat sheet of other values available for use in this dialogue box? Thanks.
I’d also like to know how to use the plugin’s 12 custom fields in the caption builder. I’ve guessed at several formats without success.
I photograph sports and use a standard short caption for all of my photos. I could use four custom fields (cf1 home team, cf2 visiting team, cf3 level, cf4 sport) to automatically generate a part of the captions, e.g., {cf1} @ {cf2} {cf3} {cf4} becomes “McLean Highlanders @ Yorktown Patriots Varsity football”
Thanks.
They can’t be, though I can see why one might want this (and to use custom fields from other plugins). I’ll have a look at this, but no promises.
Disappointing, but I understand. I’ll hold out hope it is possible without being a major effort. Thanks.
Revision 1.58.7 includes custom fields
Which fields do you mean, Patrick? Maybe these came from a custom list?
{monthname} and {year}. Neither are in the picklist on the copy of the plugin I downloaded this weekend, and both work on my machine as well. I assume there are other codes that would also work that just aren’t visible to us. I’m fine with an offline cheat sheet if the picklist would be too cumbersome.
OK, that was an oversight. If you download it again, the revision 1.58.6 includes those extra fields. I’ll take a look at the custom too.
I’m a newbie using this tool. I’m using it for captioning sports for a wire service. Does someone have a sample template or a tutorial that I can follow?
Darrell, where the post says “If you want to experiment with the custom codes feature, here is a zip file of sample files”, follow the link.
This plug in is exactly what I have been looking for. Is this still in development?
Is there a way for the plug-in to build the caption on export?
Yes, I have made small changes but I should just release this version.
It doesn’t work on export. To do so, it would be a very different type of plugin.
Thanks John. I’ll download it and give it a try.
John, I’ve been experimenting with the caption builder feature of the Search and Replace plugin. A problem arises when I try to use the vertical bar “|” character as a separator between text or tokens. The plugin seems to recognize the vertical bar as a line break. What I’m trying to replicate is shown on David Coleman’s blog (http://havecamerawilltravel.com/photographer/captions-lightroom-tokens). Is there a way to use the vertical bar as a text character with this plugin?
Joe, some early feedback was that people wanted an easy way to enter line breaks, and I thought no-one would use “|”. I guess I’ll have to make this user-definable. Thanks.
OK, try downloading a revised version 1.54.3.1.
This allows you to choose which character to use for line breaks. “|” remains the default, but “#” or any other single character should work.
Now I’m able reproduce this bug. Just create a empty caption template pressing plus sign. Then close plugin and try to restart it and it fails.
There is one feature which I’d like to have. I’m making multiline captions and many times one of the fields is empty which creates unnecessary empty lines to caption. It would be nice to have conditional carriage return which is not applied if last character is already a CR.
Thanks, Tomi. I think I recognize the bug as one I hit it before. I just need to work my way through the files and review how they were saved.
I figured out that resetting plugin preferences made it work again. Only clue about this what I can think about is one problem with caption builder little before it stopped working. I had saved template for caption I like but it magically disappeared so I made it again.
I bought this yesterday and was very happy with caption builder feature with version 1.52.1. Today evening plugin just gives an error when starting it. I already tried older 1.48 and it works. I’m using LR5.6 with OSX 10.9.5.
Plug-in error log for plug-in at: /Users/tomppa/Library/Application Support/Adobe/Lightroom/PlugIns/findreplace.lrplugin
**** Error 1
An error occurred while attempting to run one of the plug-in’s scripts.
Invalid parameter not satisfying: aString != nil
**** Error 2
The plug-in encountered an error when performing the menu item “&Search, replace, append and transfer”.
Invalid parameter not satisfying: aString != nil
Thanks, I can’t reproduce it on my Mac but I’ve an idea where the error may lie and will take a look at it. 1.48 is still the official version.
John – Yes…sorry, I forgot to list that. I am still on version 4.4 (64-bit). Didn’t even think about that being the problem. Thanks. I needed another reason to upgrade. Guess I’ve got it now!
I guess I could make it available for 4, though I feel it’s better to put time into new features rather than figuring out backwards compatibility!
John – Caption Builder is something I’ve been looking for and Jeff Friedl pointed me to your site. However, I installed the trial findreplace plugin above (ver. 1.52.1) and do not see the “Caption Builder” tab. I see the other 5 tabs (as if it were the older version). Am I missing something? Thanks….
Dan, could you be using an older version of Lightroom?
Hi John, and Happy New Year to you. I’ve used the new caption builder functionality successfully a few times now, but I notice you’ve not formally released it on Photographers’ Toolbox yet. I just wondered if you still have further work to do on it or whether it will be released soon.
On a separate note I see from previous postings on this plugin that at one time you were considering including a spell checking capability. Is that still on the cards, or have you decided to drop the idea? If it’s feasible it’s a capability I would very much welcome.
And Happy New Year too, Roger, and sorry for the delay – somehow I overlooked your comment.
It’s only unreleased because I was away over Christmas and busy since. I’ve made minor changes, but it’s ready.
As for the spell-checking, I’ve just never got round to it! One day….
Hi John,
I have been experimenting with the new Caption Builder feature in the Search and Replace plugin. I have built some basic Caption pre-sets and set up a (very) basic Short Code list. (For my purpose, this list of Short Codes consists of a list of codes representing peoples names).
I have been very pleased with the results so far and I am happy to purchase the full Search and Replace plugin. I would just like to confirm that the ’10 image’ restriction will not be present on the purchased version of Search and Replace, allowing me to build captions for any number of pictures?
With regard to the use of the Caption Builder, is it possible that the Short Code can be inserted before a Caption Pre-set is added? For example, if the Short Codes referred to names, the name would appear first, followed by the Caption pre-set (location, date and so on)
Thank you in anticipation of your reply. Incidentally, congratulations on “Digital Photo Workflow”: a lovely little book, packed with insight and ‘no nonsense’ information.
Yes that restriction does disappear. I’ll think about the captions again again, maybe for the next revision.
Glad you enjoyed the book. Quite a task to squeeze so much into so few pages!
Hi John. I’ve given the plugin a test and it’s looking good. I like the capability to include the IPTC fields as tags in the shortcodes. I’m running on windows 7 so I can’t say whether the Mac bug is sorted or not.
The only problem I’ve found so far is that if the shortcodes file contains a blank line it causes a crash when the plugin reads the file:
An internal error has occured: tab_CaptionBuilder.lua:188: bad argument #1 to ‘sub’ (string expected, got nil)
So if you can add a check to ignore blank lines in the file it would be good – it took me a while to figure out the problem as I had a CR/LF at the end of the file rather than a blank line in the middle and so it wasn’t visually obvious.
I’ll keep trying it out and report any other problems that I spot.
Further clarification – the error also occurs if the “=” is missed out from a line, which I just did by mistake…
Yeah, there’s not much error handling!
I’ve uploaded a new version which should prevent the two problems you’ve identified, but with text files there will always be ways for users to misbehave….
Thanks John, I’ll download and test it this evening. I’ll try not to misbehave too much when testing the text file 🙂
I’ve given the short code functionality a good try out and it’s working very well, it does a great job of creating the captions from the text in the file. Thanks for allowing blank lines in the file; it makes it more human-readable when adding or editing the text.
I’ve a suggestion/request for the UI – in the drop down list of short codes it shows as much as it can of the whole line from the file, but all I’m really interested in is the short code part, so I’d prefer it if the drop down just displayed everything up to but not including the equals sign. It’s possible that some people might like to see what’s after the short code to help them select the correct one, but as I’m using short codes such as “Barn Owl” and “African Fish Eagle” I don’t need to see anything other than the short code in the drop down list.
OK, that makes sense. It probably needs both approaches so I’ll make it an option. Thanks.
Yes, that looks as though it could be a viable way to go. To check my understanding of your proposal (and add a few thoughts):
The token names for “variables” in the file obviously couldn’t be the same as those used for the built-in metadata tokens. So when parsing the caption, if the plugin finds a {token} which is not a built-in token then it checks the file to see if it is an externally defined token. There will need to be some way to define the path to and name of the file in the plugin. If {token} doesn’t exist in the external file then it just ignores it and carries on, which is consistent with, for example using a location token for an image which has no location defined in the metadata.
The format of the external file is, generically:
Token=text
Everything from the start of the line up to but not including the “=” is the token name, everything after the “=” is the value to be inserted into the caption. Having to fit the caption on a single line could be a limitation; some of my captions are three or four paragraphs. So at least the possibility to include line breaks within the caption (maybe {br}? ) would be needed, or the ability to have multi-line variables, perhaps with a special token to indicate the end of the variable? Something like:
Towl=The Tawny Owl is a bird.
It lives in woodland.
It goes “Twit-Twoo”.
{End}
Bowl=The Barn Owl…
Thanks for listening, I hope I’m not wandering off and over-complicating this!
Yes, that’s exactly what I’m thinking and I’ve got it working already (get the idea I can see uses for it myself?). I’ve just got to add a way for the user to set the name of the text file and then I’ll update the test version so you can break it.
One important detail is that for best results the text file’s encoding should be UTF-8.
OK, I’ve updated the plugin. There was an awkward Mac-only bug which I hope I’ve caught – hope because it stopped before I was 100% certain I had got it nailed. Scream if it’s still there.
I’ve also left a demo text file here https://dl.dropboxusercontent.com/u/7678369/Shortcodes.txt. Notice how you can also use existing IPTC fields as variables in the text file.
This is an interesting idea John; I will download the zip file and have a play. To build on Nic’s comment above, a lot of my captions can’t be built from other metadata fields, but I have a suggestion which may or may not be feasible.
I take a lot of wildlife shots, and my captions usually include some descriptive information about the animal in the picture. The way I manage this at the moment is to write the captions in MS Word and save them for future use. So for example, if I return from a shoot with ten pictures of a Tawny Owl, I know I’ve already written a Tawny Owl caption so I copy it from word and paste it into the ten shots, and then maybe add a little image specific detail to each one if necessary.
Would it be possible for you to include a token to read in text from an external file? (I’m thinking plain text rather than MS Word format). I would envisage then building, for example, a Tawny Owl present which reads in that file and adds some other information from tokens as you show above. If that’s possible it would be a really useful tool for my situation.
I had been toying with that kind of workflow, but why wouldn’t you use a metadata preset on such occasions? After all, it would update keywords too.
And I’ve toyed with the idea of using metadata presets! Yes, I could create a preset for each caption, and it would be workable if there aren’t too many, but Lightroom has no facilities to filter, organise or search through long lists of presets, so I find it’s easier to create and maintain them externally. I see a couple of advantages of your caption builder, one is that the preset list would only be captions, not a mixture of captions and all of the other presets I might have, the other is the new capability to automatically bring in other metadata items such as the location. So for my particular workflow, pulling in the “static” data from a file and augmenting it with other metadata automatically would be ideal, but I realise I might be in a minority of one in requesting it!
OK, that makes sense. Have you ever seen features like PhotoMechanic’s “code replacement” or how you can use AutoCorrect in MS Word? So it’s not that weird a request. I’m thinking that one would type {towl} and it would make the plugin look for a text file and grab the variable defined in a text file.
The problem is the text file’s format. My initial thought is to have a file such as this where the code could detect the “=” sign and the line end
towl=The tawny owl is an owl the size of a pigeon. It has a rounded body and head, with a ring of dark feathers around its face surrounding the dark …
bowl=The barn owl is…
How does that work?
Yes, whilst I hope some of my captions for Stock images are more involved a large proportion could be built (quickly) like this. Useful.
The question is, how much more involved? I’m going to add codes for day of the week, the month name, and other ways of displaying dates.