BFEP: An Export Plugin for Lightroom

An export to disk plugin for Lightroom that aids the process of managing and tracking photo exports.

Download the Plugin


  • Add keywords to images in Lightroom as they’re exported
  • Add a ‘BFEPExportData’ metadata Field to which date and keyword information is added every time a photo is exported by the plugin. For tracking when a photo has been exported and with what tags
  • Sort photos in a collection based on dates and tags in the BFEPExportData metadata
  • Optionally run a script post export or app that may apply processes to the image. Most commonly the script will be, Bash, AppleScript or Python.

Export scripts might, for example:

  • Add borders to images
  • Add square padding for Instagram
  • Automatically post images to Twitter
  • Email to IFTTT, Evernote, or even people
  • Export to Apple’s Photos app

Example scripts are included with the plugin


Install the unzipped plugin as you would any plugin using Lightroom’s Plugin Manager File->Plug-In Manager.

Using the plugin

Screenshot 2020-06-23 at 07.30.23

Select BFEP for export using the ‘Export To’ drop-down menu at the top of the Export dialog. Export in the normal way.


Add keywords you wish added to export images, comma separated, to the Keywords input box in the plugin dialog. You may find it useful to save export settings for particular destinations in the export list to the left of the dialog. Keywords are added as children of the BFEP keyword.

Post Export Scripts

Note: Mac only instructions. Windows may be possible but is untried.

Enter the path to the script you wish to run in the Post Script entry box in the export dialog or browse to the script using the Browse for Script button above the entry box. If you wish to pass parameters, for example a border width or email address, to the script enter them, separated by commas, into the Parameters entry box. Avoid new lines in the parameter list.

By default your script will be run by Bash. If you wish it to be run by anything else – Python, PHP, AppleScript – include a shebang at the top of the file with the full path to programme you would like to run it with. For example:


def foo( arg ):
    print( arg )

When the plugin calls the script it includes parameters set in the Parameters entry box on the command line:

<script> PathToExportedImageFile commaSeparatedKeywordList commaSeparatedParameterList

Script Output and Debugging

Script stdout – bash ‘echo’, python ‘print()’ – and stderr is redirected to a log file named after the script file and placed in the same directory as the script. In MacOS you may also use system notifications:

From Bash:
osascript -e 'display notification "Hello world!" with title "Hi!"'

Or from AppleScript just:
display notification "Hello world!" with title "Hi!"

If the script returns non-zero then an error box is displayed containing the contents of the output log. The plugin output log file is debug.log in the plugin root folder


To help in tracking when and where photos have been exported, BFEP adds information about keywords and export dates to the photos’ BFEPExportData metadata.

Sorting on Metadata

It’s sometimes useful to view photos sorted into export date order for any given export keyword. The plugin can sort on dates for any one keyword in the metadata. BFEP creates a collection set and adds ‘Sorted’ and ‘Unsortable’ collections to which photos in a selected collection are added in order. ‘Unsortable’ photos are photos that contain no BFEPExportData metadata or no data for the sort criteria.

The Sort command can be found in File->plugin-extras->BFEP Sort. Make sure to set the new collection’s sort order to ‘custom’ after sorting, this has to be set by hand.

Example Post Export Scripts

A set of example scripts are included with the plugin it the Scripts folder.


Adds a border to exported images using convert. You can add width & colour parameters in the BFEP dialog box, width followed by colour. Width is a percentage of the image size, without the ‘%’ character. For colour see the convert colour documentation. Width defaults to 0.5 (thin), colour to black


Mails the exported image somewhere. Parameters need to be given in the dialog Parameters box, sender, recipient, content in that order


Imports exported images into the Apple Photos app. Useful for posting images to Instagram.
By default exported images go into a BFEP album. A different album can be given in the Parameters entry box


Tweet an image. You’ll need Tweetbot installed for this. The script opens Tweetbot with a new tweet window open and the exported image attached ready for you to add text.


Pad an image to square by adding padding equally to either end of the shortest edge. Padding colour defaults to white. Set your own colour by adding a parameter to the Parameters entry box. See  convert colour documentation  for available colour parameters.


Prep an image for Instagram by adding a thin black border and padding to square with white

Leave a Reply