Twice recently I’ve seen people asking about getting a simple list of filenames to copy and email, and I wrote this little script for one of them. But I just saw someone asking again, so here it is (zip file) – free in celebration of my having gone through January without a beer, glass of wine, sip of single malt etc.lrdownload

To install it

In your LR application support folder (find it by Preferences > Presets > Show Lightroom Presets Folder), create a folder called Scripts. This new folder should be in the same Lightroom folder as ones like Smart Collection Templates, Text Style Presets etc.

Unzip the file and save the little lua file in there. Restart LR and you’ll have a scripts menu to the right of Help.

Select a bunch of pictures, run the Filenames script, and you’ll see something like this:

Screen Shot 2013-01-31 at 19.15.23

Update 27 Nov 2021

You can easily modify this script to get other fields. The key line is getFormattedMetadata(‘fileName’) where the script calls a function and passes LR’s internal field name as an argument. So you just need to copy this script and change that field name? sdkWell, not quite.

There are two problems. One is the internal field name, which you can sometimes guess or work out by editing a metadata template in Notepad or TextEdit. The other difficulty is that some fields like file name are called by the getFormattedMetadata function while others like the path are called using getRawMetadata.Which do you need?

I’m glad to say that this is documented in Adobe’s Lightroom Classic SDK. You need to look in the LrPhoto section which lists the field names and the corresponding functions.

In the comments (no longer displayed) Hans asked about the full folder path, so in this case you’d change getFormattedMetadata(‘fileName’) to getRawMetadata(‘path’). Restart LR and you’re done.

On text editors

Incidentally, if you have Photoshop or the Creative Suite, you can use Adobe’s Extend Script Toolkit as your editor instead of Notepad or TextEdit. It allows you to format the code for Lua and it’s not over the head of those like me who’re unnaturally frightened of real programmers and their very clever integrated editing environments. Another good option for Mac is BB Edit, and this is now my preference on Mac.

One important detail is the text encoding which should be UTF-8. This is pretty simple to set in any text editor: