Jeffrey’s “Run Any Command” Lightroom Export Plugin

This plugin for Adobe Lightroom provides two separate (but sort of related) functions:

1) It provides an export filter that allows you to run a command of your choosing with each exported file, as part of the export while its going on (and/or on all the exported files as a group, after the last one has been rendered).

2) Via a new entry to the File > Plugin Extras menu, it lets you apply a command of your choosing on the master image files selected in Library.

This plugin works in Lightroom 6/CC (and older versions as far back as Lightroom 3, though some features depend on the version of Lightroom).

Export Filter

This plugin provides an export filter that provides access to the rendered copy of an image being exported, during the export. It can be used with Lightroom's built-in exports, and with any Export/Publish plugin.

The plugin adds a section to the Export/Publish dialog like this:

The top box is for the command to be executed during each image's render, while the bottom box is to be executed once, after all images have been rendered. You can use either, or both.

If there are other export filters, the filters are invoked for each image in the order that they appear in the Publish/Export dialog (an order that you can adjust while the dialog is displayed). If your command makes changes to the rendered copy of the image, filters that come later in the export pipeline, as well as the main controlling Export/Publish plugin (if any), work with that changed image.

Command Metasequences

Before a command is actually executed, special token sequences are recognized and replaced by the plugin. For example, the token {desktop} is replaced by the full path to the user's Desktop folder.

The set of tokens recognized depends on the situation.

The per-image Command to Execute command supports all the general tokens of my plugins' preset templates, so you can use image-specific metadata on your command line.

In addition to those tokens, the following are also recognized within this command:

SequenceReplaced By
{FILE}The name of the exported image file, with full path.
{file}The name of the exported image file, without the leading path.
{NAME}The name of the exported image file, with full path, but without the file extension.
{name}The name of the exported image file, without the leading path and without the file extension.
{folder} Full path of the folder that the exported file lies in.
{home} Full path of the user-dependent home folder.
{desktop} Full path of the user-dependent Desktop folder.
{pictures} Full path of the user-dependent picture folder (My Pictures or Pictures).
{documents}  Full path of the user-dependent document folder (My Documents or Documents).
{temp} Full path of a system-dependent temporary folder.

The overall Command to execute upon completion command supports the following tokens:

SequenceReplaced By
{FILES} The full path of all images rendered for the export, each surrounded by double quotes, separated by spaces.
{qFILES} The full path of all images rendered for the export, each surrounded by single quotes, separated by spaces.
{xFILES} The full path of all images rendered for the export separated by spaces.
{COUNT} The count of images rendered for the export.
{MANIFEST} A temporary file that includes the full path of all images rendered for the export, one per line. (The temporary file is deleted by the plugin after the command has executed.)
{home} Full path of the user-dependent home folder.
{desktop} Full path of the user-dependent Desktop folder.
{pictures} Full path of the user-dependent picture folder (My Pictures or Pictures).
{documents}  Full path of the user-dependent document folder (My Documents or Documents).
{temp} Full path of a system-dependent temporary folder.

Quoting

Be warned that you must be very careful about where to quote items: anything that has a space or other special shell variables must be quoted, but exactly what must be quoted, when, and with what kind of quotes is dependent on the operating system. It's fairly straightforward on a Mac: single quotes will almost always be okay, double quotes probably okay in most cases as well. On Windows, use double quotes and cross your fingers.

You'll probably end up using "{FILE}" (or, on a Mac, '{FILE}') in every command.

Here's a concrete example using Phil Harvey's most-excellent exiftool to insert a copyright notice into the jpeg image-comment field. Here it is for Windows:

"C:\path\to\exiftool.exe"   -overwrite_original    "-Comment=Copyright {yyyy} {Artist}"    "{FILE}"

And on a Mac:

'/path/to/my/exiftool'     -overwrite_original     '-Comment=Copyright {yyyy} {Artist}'    '{FILE}'

Each uses the {FILE} token with appropriate quotes, and also two preset-template tokens.

Logging

Details about each command executed and its results are kept in the plugin log, which is referenced in the upper-right section of the Plugin Manager.

Availability

This plugin is distributed as “donationware”. I have chosen to make it available for free — everyone can use it forever, without cost of any kind — but unless registered, its functionality is somewhat reduced after six weeks.

Registration is done via PayPal, and if you choose to register, it costs the minimum 1-cent PayPal fee; any amount you'd like to add beyond PayPal's sliding fees as a gift to me is completely optional, and completely appreciated.

Note: a Lightroom major upgrade, such as from Lr5 to Lr6, de-registers the plugin in the upgraded version, so if you want to maintain registration, a new (\$0.01 if you like) registration code is needed in the upgraded version. It makes for a hassle every couple of years, I know. Sorry. See this note for details.

For details on plugin registration and on how I came into this hobby of Lightroom plugin development, see my Plugin Registration page.

Version History
( Update Log via RSS )

 2.01512e+07 Fixed how custom {People} formatting works with people keywords that have no birthday associated with them.
 2.01512e+07 Added ChildOf and DescendantOf filters to the {Keywords} and {KeywordsAll} template tokens that my plugins understand.
 2.0151e+07 Added {SpeedKPH} and {SpeedMPH} to the list of template tokens supported by my plugins. The {People} token wasn't working properly for some keywords without a registered birthday.
 2.01505e+07 Fixed the "SpecPeople:259: attemt to index al nil value" error.
 2.01502e+07 Command wasn't being applied to rendered video files. On OSX, allow text in the error-report dialog to be selected and copied.
 2.01502e+07 In the POODLE-vunerability dialog, display a raw URL of a page on my site that discusses the issue, so that folks can be independently sure that the dialog is indeed from me and not malware.
 2.01501e+07 Fix to the date_diff() function supported by the LUA template token. Updated the camera-name code to try to guess the actual camera model of Hasselblad H5D files, since in their infinite wisdom Hasselblad decided to encode three distinct models with the same internal code, making it impossible to know for sure what camera produced a given image file.
 2.01412e+07 Registration was broken on Lr2
 2.0141e+07 Windows Only: Add a one-time check for the POODLE security vulnerability, and alert the user if it exists.
 2.01409e+07 Added the LrMD5, LrLocalization, LrSystemInfo, and LrMath packages to the {LUA} template token.
 2.01409e+07 Added a rudimentary "apply custom command to selected master image files" functionality. See the File > Plugin Extras > jf Run Any Command menu to configure and launch.
 2.01409e+07 New build system
 2.01408e+07 Made the {GPSAltitude}, {Altitude}, and {GPSCoordinates} tokens subject to the geo-privacy settings like the other geo-related tokens.
 2.01407e+07 Registration fix for Lr5.6
 2.01407e+07 Previous updates broke support on Lightroom 2
 2.01407e+07 More Creative-Cloud support.
 2.01407e+07 Fixed an issue with Creative-Cloud revalidation.
 2.01407e+07 Lr5.5 and later Creative-Cloud installs can now revalidate themselves if needed.
 2.01407e+07 Sigh, had a bug in the Creative-Cloud support.
 2.01407e+07 Now supports Lr5.5+ Creative-Cloud Installs.
 2.01407e+07 Sigh, introduced an error for some folks with the rebuild the other day.
 2.01406e+07 Build-system update
 2.01406e+07 Added date_diff() and raw_time_diff() functions to the special {LUA} token understood by the plugin.
 2.01405e+07 Added new tokens to the template language the plugin understands: LrVersion, LrVersionMajor, LrVersionMinor, LrVersionRevision, LrVersionBuild, Location, CatalogName, CatalogPath, OperatingSystem, OS Added new token filters: NS and LO
 2.01404e+07 Fix a location-related template-token bug introduced in a recent build.
 2.01404e+07 Fixed a bug in the "smoother revalidation" stuff recently added.
 2.01404e+07 The {Empty} template token wasn't working properly. Make the revalidation process smoother, especially for folks using Lr5.4 and later.
 2.01309e+07 Oops, fix a bug introduced in the previous update
 2.01309e+07 Added a bunch of tokens to the preset templates supported: ExportFormat, ExportColorSpace, ExportBitDepth, ExportQuality, ExportSharpeningLevel, ExportSharpeningMedia, IpernityUrl, GoogleDriveUrl, and TumblrUrl. The token-examples dialog had been broken. Also deprecated Folder and Path tokens in preference to FolderName and FolderPath tokens. Fixed the KW/KWE tables used by the LUA token; they had been broken when using load for the script.
 2.01306e+07 Better support for plugin revalidation.
 2.01306e+07 Yet another Lr5 update
 2.01305e+07 Apparently, a recent change broke things on Lr2, which some folks apparently still use.
 2.01305e+07 Update for Lr5
 2.01304e+07 Build system update.
 2.01303e+07 Fix for the registration system.
 2.01302e+07 Added support for some new template tokens: FlagStatus (requires Lr4.1 or later), and for Lr3 and later, a bunch of IPTC extended metadata: AdditionalModelInfo, CodeOfOrgShown, DigImageGUID, Event, ImageSupplierImageId, MinorModelAge, ModelAge, ModelReleaseID, ModelReleaseStatus, NameOfOrgShown, PersonShown, PlusVersion, PropertyReleaseID, PropertyReleaseStatus, and SourceType.
 2.01302e+07 More build-system maintenance
 2.01302e+07 Tweak for my registration system
 2.0121e+07 Enhance the {EMPTY} template token so that it interrupts the squelching of superfluous joining characters.
 2.01208e+07 Updates to the environment in the {LUA} token (in the template tokens in my plugins) to include photoTime() and currentTime(), and other changes to match the updated docs at that link..
 2.01206e+07 Fix an "attempt to perform arithmetic on field" error.
 2.01205e+07 Update to handle the Mac App Store version of Lightroom. Tweak for Lr4.1RC2. Added to the template tokens supported by the plugin: {FullMasterFolder}, {FullExportedFile}, and {FullExportedFolder}, and to match, renamed the recently-added {FullMasterPath} to {FullMasterFile}.
 2.01204e+07 Enhanced the send-log dialog to hopefully make reports more meaningful to me, yielding, I hope, the ability to respond more sensibly to more reports. Added {FullMasterPath} to the list of template tokens supported by the plugin.
 2.01203e+07 Update to handle 4.1RC.
 2.01203e+07 Had broken registrations in Lr2; Update to the debug logging to better track down timing issues that might arise.
 2.01203e+07 More on the march toward Lr4, including upheaval in the code to handle Lightroom APIs being discontinued in Lr4. Added the {AspectRatio} token to the token templates understood by the plugin, and added the Length=num filter.
 2.01201e+07 More tweaks for Lr4b
 2.01201e+07 Update for Lr4 beta: explain in the plugin manager that the plugin can't be registered in the beta.
 2.01112e+07 Had issues with the registration button sometimes not showing. When doing a plugin upgrade, offer the ability to flush all the old copies of the plugin. Added a system-clock check and reports to the user if the system clock is more than a minute out of date. An incorrect system clock can cause problems with various kinds of communication and authentication with some of my plugins, so I've just gone ahead and added this to every plugin.
 2.0111e+07 The {Path} token wasn't working properly.
 2.01106e+07 In some cases where the command could not be run, the plugin crashed instead of reporting the error.
 2.01101e+07 Added {CroppedWidth} and {CroppedHeight} to the template tokens used by my plugins.
 2.01008e+07 Made the revalidation process much simpler, doing away with the silly need for a revalidation file.
 2.01008e+07 Discovered a bug in my plugin build system that caused horribly difficult-to-track-down errors in one plugin, so am pushing out rebuilt versions of all plugins just in case.
 2.01008e+07 Added code to allow plugin revalidation after having been locked due to a bad Lightroom serial number.
 2.01007e+07 Figured out how to add the ability to run a command after all files have exported.
 2.01006e+07 Yikes, shaking out some more build issues.
 2.01006e+07 Discovered a nasty build bug; pushing a new version in case it affects this plugin.
 2.01006e+07 This version can be registered in Lightroom 3. It can run in Lightroom 2 or Lightroom 3; it does not work in the Lr3 betas. It uses my new registration system when run on Lightroom 3, which avoids some of the silly issues of the old one. Please take care to note the details on the registration page: use of this version (or later) of the plugin in Lightroom 3 requires a new registration code, even if you had registered some older version of the plugin.
 2.01005e+07 Update for the Lr3 beta.
 2.01003e+07 Added new tokens to the templates that my plugins use, CameraName, IfGeoencoded, Keywords, IfKeyword, IfExportedKeyword, and LUA. See the templates page for details.
 2.01003e+07 Fixed up some issues with the help dialog, and added a warning referring to it if the user command doesn't seem to refer to the exported image. Changed the semantics of the Places filter (in the tokens understood by the preset templates of my plugins) in two ways: if applied to a string value rather than a number, it works on the first number found in the string. Another is that you can now use something like Places=-1 to round to the 10s, Places=-2 to round to the 100s, etc.
 2.01002e+07 Fixed the {GPSAltitude} template token so that it should now actually work. Completely changed how the one-click upgrade applies the newly-downloaded zip file, in the hopes that it'll work for more people. Rather than unzipping over the old copy, it now unzips to a temporary folder, then moves the old folder out of the way and the new folder into place. Prior versions' folders are now maintained (with the version number in the folder) in case you want to revert a version; you may want to clear them out from time to time. Of course, it won't take affect until you try to upgrade after having upgraded to or beyond this version.
 2.01001e+07 Added two new template tokens, {DaysSince} and {PhotoDaysSince}. They're a bit tricky, but could be useful.
 2.00912e+07 Added the ability to save command presets.
 2.00912e+07 Minor internal debugging tweaks.
 2.00911e+07 Added an {Altitude} item to the templates understood by the plugin. It's the numeric altitude in meters, as opposed to the {GPSAltitude} item which is a description of the altitude along the lines of “32.7 m”. Also updated the Places filter so that it can be used on fields that merely begin with a number.
 2.0091e+07 Added a first draft of some rudimentary support for Lightroom 3 Beta. See this important note about plugin support in Lightroom 3 Beta and Lightroom 3, including future plans for features and my registration system.
 2.00907e+07 Enhanced the one-click upgrade stuff quite a bit, now detecting ahead of time when it will fail because the plugin is installed where Lightroom can't write (if Lightroom can't write to it, it can't update itself). I also added a progress bar, and now download in smaller chunks to avoid 'out of memory' errors on the larger plugins. Do remember that this new functionality becomes available after you upgrade to or past this version, when you then upgrade with it.
 2.00906e+07 Fixed a boo-boo in the help dialog, and added a note that command-line quotes should be ASCII, never "smart quotes".
 2.00905e+07 Fixed a "loadstring" error some users got.
 2.00904e+07 Tweaked how the plugin tries to update itself during the one-click upgrade process, to hopefully get things working for those few Windows users that have never had it work. Crossing fingers. We'll see.
 2.00903e+07 It seems that PayPal doesn't give everyone a "Unique Transaction ID" in the registration confirmation mail; some people get a "Receipt Number". So, the registration dialog now accepts that as well.
 2.00902e+07 Fixed a bug that caused a plugin crash if my server couldn't be reached during registration.
 2.00902e+07 NOTE: you may need to restart Lightroom after installing to this (or a later) version from the previous (or an earlier) version. Please try a restart if you get an error the first time you try to use the plugin. As per the ongoing discussion on my blog, with this version this plugin moves over to a "donationware" model, in which the plugin remains free, but registration eventually becomes required (and an eventual donation hoped for ). For details, see Lightroom Plugin Development: Now With Added Encouragement. (For info about what drove this decision, see What To Do When a Hobby Becomes Work?) The plugin no longer expires, and correspondingly, I will not pay much attention to reports of bugs that have already been fixed, so please check your version and the version history before submitting bugs or feature requests. There was a lot of internal upheaval in the code, so I expect that some boo-boos my surface. If something breaks for you with this version, please let me know, but until I fix it, feel free to revert to the previous version.
 2.00902e+07 Bumping expiration into the future.
 2.00901e+07 Oops, forgot to include the unzipper in the plugin, so the automatic upgrade won't work on Windows until after you manually upgrade to this version.
 2.00901e+07 Added an option to ignore errors generated by the command.
 2.00901e+07 Small housekeeping update for the new locales supported by Lightroom 2.3.
 2.00901e+07 Initial public release

The 30 most-recent comments (out of 40; see all), most recent last...

Hi,

I would like to share with the other this tip: if you want to execute two commands a time with this plugin, you need to put a && without quotes between the two. It worked for me for the command

'/opt/local/bin/mogrify' -raise 50 '{FILE}' && '/opt/local/bin/composite' '-gravity' 'SouthEast' '/path/to/Pictures/lightroom/identity.png' '{FILE}' '{FILE}'

Hope it will help someone, and hope this was not obvious to anyone but me.

Giovanni

— comment by Giovanni Lanzani on April 8th, 2009 at 6:06am JST (6 years, 10 months ago) comment permalink

Jeffrey – I’m from the SF Bay Area. It’s been a long time since I was writing command lines, however, it seems like I should be able to use the plugin to open a webpage. Can you give me an example of a command line to open a webpage? Thank you.

The plugin allows you to execute commands, so you just need to figure out what command to execute to open a web page. If you use Firefox, you can check out its command-line arguments, or perhaps even just tell the operating system that you want to open a web page, e.g. "open http://…..somepage.html". I know I’ve seen something like that, but I don’t recall where. Perhaps for OSX. Open up a Command prompt (Windows) or Terminal (OSX) and test what works, then use the result in the plugin. —Jeffrey

— comment by Jay B on April 30th, 2009 at 9:01am JST (6 years, 9 months ago) comment permalink

Jeffrey,
Can you help me understand what this error code means? My droplet seems to be running the first command of the Action, but not the second. Hopefully there is a simple setting involved. Thanks,
Nick

+92.9: [144527E0] line 6608: STATUS is 1
+92.9: [144527E0] line 6625: Ignoring the error, as per the user setting
+92.9: [144527E0] line 6606: Running: ""C:\NR+Pre-Sharp.exe" "S:\2009\2009-05-17 Roeper Choir\Pass 1\2009-05-17 Poeper Choir Requiem-2.psd" 1> "C:\DOCUME~1\Parents\LOCALS~1\Temp\LR-571" 2>&1"


I’ve never tried putting multiple commands, but at a minimum you’d have to separate them by semicolons, but perhaps even then it won’t work, and you’d need to drop them into a batch file that you then reference from the plugin. —Jeffrey

— comment by NickP on May 18th, 2009 at 7:57am JST (6 years, 9 months ago) comment permalink

Jeffery,
The strange thing is that I only have the following on the caommand line…

"C:\NR+Pre-Sharp.exe"  "{FILE}"

(I also unchecked the “ignore errors” because I wanted to see why the droplet wasn’t running. Maybe that is what is causing the second command?)

Before I did the recent upgrade, the droplet seemed to work fine.

Nick

Oops, sorry, the reference to multiple commands came from my lack of coffee this morning, not from your post. I’m not sure what’s going on, but it could be that your program (NR+Pre-Sharp.exe) is working fine, but returning an error status (perhaps because it hasn’t had its coffee yet, too). Maybe send me a log via the “Send to Jeffrey” button in the Plugin Manager, and perhaps I can figure something out… —Jeffrey

— comment by NickP on May 18th, 2009 at 8:28am JST (6 years, 9 months ago) comment permalink

Hi Jeffrey! Greetings from Japan!
I’m in the U.S. Navy and trying to figure out a better workflow for all the photos I take for my office.
Your export plug-in seems like a great idea. I’d like to apply it to have the photos open up in the Windows XP built-in CD burner. I’m trying to find the command-line arguments for it, but haven’t had any luck yet.
Do you by any chance know how to execute it?
Thank you again.

I don’t know anything about XP’s CD burning, sorry, but you know that it’s built in to the normal export, right? —Jeffrey

— comment by Matthew Schwarz on May 20th, 2009 at 2:42am JST (6 years, 9 months ago) comment permalink

Wow! Fast reply. I guess it is because I’m up at 2:52 a.m. my time, and you are halfway across the world.

I’m in Kyoto. Can’t sleep. —Jeffrey

I know that I can burn CDs from within Lightroom, but it always finalizes the discs. I’d like to process one set of photos and then export them to folders while at the same time queuing the exports up to burn with Win XP’s built-in burner. Then I could process another set of photos and do the same. Once I’m completely done with all the sets of photos I could just hit BURN and have the day’s photos on one disc (that isn’t finalized!!)
I’ll keep digging for now. Thanks so much.

— comment by Matthew Schwarz on May 20th, 2009 at 2:53am JST (6 years, 9 months ago) comment permalink

I have built a simple command-line email sender to use with Lightroom 2. It is fully configurable from the command-line parameters and/or a config file. I use it with this plug-in and love it! Thanks for proving a simple way to do additional processing!

— comment by Andy Miller on July 8th, 2009 at 11:56am JST (6 years, 7 months ago) comment permalink

Hi Jeffrey. NJ here.
I am lost. I have the exporter to Zenfolio which I understand. This run any command has me baffled. My wokflow is simple…

Shoot
Export low-Res Jpegs to desktop folder w/ PP action droplet
PS4 opens file and applies my actions & closes files
I then open Zenfolio and drag them to folder & upload

Now, this takes time and I have to hang around and wait for the export, action apply & uploading. What command would I write to have PS4 open the files and run the actions I designed.

JA

I don’t have any personal experience with photoshop droplets, but I assume that they are files that you can execute, passing image filenames as arguments. In that case, you’d want to put the name of the droplet filename followed by "{FILE}" as the command. You can combine this with my Zenfolio plugin, and have a fire-and-forget solution that does it all…. —Jeffrey

— comment by John @ JargaPix on October 6th, 2009 at 2:26pm JST (6 years, 4 months ago) comment permalink

Hi Jeffrey,

I am trying to create a command with tokens to copy a photo to a sub-folder on my desktop (Mac). That sub-folder should be named to today’s date, in the format of dd.mm.yy
So for example if I were to run it today, the command would create a folder “8.11.09” on my desktop, and copy the photo to that folder.

Can help me with the syntax? I’m a bit computer challenged…
Many thanks,
N

It depends on your system (Win? Mac?), but it should be easy to do with exiftool. Check out the renaming examples in particular. —Jeffrey

— comment by nati on November 9th, 2009 at 2:08am JST (6 years, 3 months ago) comment permalink

Ahhhh, now I understand. Did not realize the role of exiftool in your export plugin.
This is wonderful. Many thanks for your help.
Nati

It’s not part of the run-any-command plugin…. you have to install it yourself, then refer to it from the command you enter into the plugin. —Jeffrey

— comment by Nati on November 10th, 2009 at 1:07am JST (6 years, 3 months ago) comment permalink

understood.
Now I have some Phil Harvey wisdom to read…
Cheers,
N

— comment by Nati on November 10th, 2009 at 11:35am JST (6 years, 3 months ago) comment permalink

Hello Jeffrey,
I’m from France in Provence 😀

Firstly, thank you for your work.
I need assistance for work by batch with your plugin.

Currently, the plugin work image by image, but I will like that it transmits the whole of the images to be treated.
Could you help me? Thank you.
Julien

For this I think you want to use the Post-Processing section of the standard export… —Jeffrey

— comment by Gotcha on January 30th, 2010 at 3:09am JST (6 years ago) comment permalink

Hello Jeffrey,

The standard export command is too basic and I believed that your solution could bring to me of the assistance.
I need to make several operation after for a batch photographs. This batch passed in argument towards other programs.

Best regards.
Julien

This plugin can’t do what you want because it has access to the exported images only for a moment during the export of each image, and doesn’t know when the overall export has finished, nor what the final image filenames might be. But the overall Export Action should be able to do what you want, because it will pass all the image filenames to the command you specify. You can make it a batch file (Windows) or script file (OSX), so you can have it do as complex an operation as you know how to program. —Jeffrey

Update July 2010 – I figured out a way process all the files at the end of an export, as of version .27 —Jeffrey

— comment by Gotcha on February 3rd, 2010 at 10:00pm JST (6 years ago) comment permalink

Can I use this to ADD keywords to a photo on export? I tried using exiftool with a basic example from the FAQ:

“exiftool -keywords-=one -keywords+=one -keywords-=two -keywords+=two”

But it didn’t add the keywords.

Your command doesn’t actually refer to the exported file (via the {FILE} token). See the help button for info on tokens. I’ve just pushed a new version of the plugin that includes a warning if the command doesn’t seem to refer to the exported image. —Jeffrey

— comment by John Vanderbeck on March 12th, 2010 at 8:43am JST (5 years, 11 months ago) comment permalink

Dear Jeffrey
(This from Sydney, Australia)
Any chance of a run any command on *Import* filter?
Currently I tediously run exiftools on files where LR (or my camera) won’t recognize the lens (such as CV manual focus lenses). What I do is copy new files to disk, run exiftools in the terminal, then import them. Things have got a bit better with the new beta, since updating exifdata didnt’ work relaibly before, I suppose now I could use LR to import, then exiftools then update.

But how cool if there were a way to run extra commands on import!

Not possible yet in LR3 )-: —Jeffrey

— comment by David on March 26th, 2010 at 7:23am JST (5 years, 10 months ago) comment permalink

Just a quick comment about opening a webpage using this tool as was asked by one of the users.
The proper command for running the default browser is:

— comment by Vit Kovalcik on May 5th, 2010 at 9:32pm JST (5 years, 9 months ago) comment permalink

I was wondering if this plugin helps you run any command on the image before it becomes JPEG — not sure I described it right, I would like to run a command on the intermediate image (may it be a BMG or TIFF,) sort of pre-processing the image.

You can do that by having Lightroom export a TIFF/PSD, then using the command to do your processing and, finally, if you want a JPEG, have it do that as well. —Jeffrey

— comment by dkwo on August 2nd, 2011 at 11:40am JST (4 years, 6 months ago) comment permalink

Can you specify the source image as a command sequence? I need to pull a maker note field from the original file and add it to the exported jpg.

Sure, you can use any of the template tokens that my plugins support, including {LIBRARYFILENAME}. —Jeffrey

— comment by Jacob on October 10th, 2011 at 12:42pm JST (4 years, 4 months ago) comment permalink

Jeffrey that helps, however when I use the {Path} token it gives the path with “>” not “\” on Win 7.

example:
D: > users > username > path > to > file

Can you specify the “\” character?

Thanks,
-Jacob

Yikes, not sure how that happened, but I’ve pushed a new release that fixes it. —Jeffrey

— comment by Jacob on October 11th, 2011 at 2:11am JST (4 years, 4 months ago) comment permalink

Hello, I am using the Run Any Command plugin to create an animated GIF in ImageMagick. I nearly have it working 100% automatically. I can select my sequence and export and I get an animated gif but the filename is always the same. The actual animateg GIF is created using an ‘execute upon completion’ command and I would like to make the filename unique so if I create several gifs they would not overwrite. Are there any template fields or some other technique available in the post processing step to get an new filename? Thanks.

— comment by Robin Cottiss on February 9th, 2012 at 1:01am JST (4 years ago) comment permalink

I have an answer to my own question but if anyone has any better suggestions let me know.

I can use an ImageMagick command to make a unique filename based on the input names. My execute on completion command looks like this:

convert -loop 0 -delay 50 {FILES} -set filename:f “output_%t” “{pictures}\TEST\%[filename:f].gif”

Note the use of the -set to make a filename based n the input. It turns out that IM uses the 1st filename in {FILES} which is perfect for my needs.

It is very cool how you can mix the Plugin template values and IM escape variables in the same command.

Robin

— comment by Robin Cottiss on February 9th, 2012 at 1:39am JST (4 years ago) comment permalink

For completeness here is what I do for the actual run command step to place a timestamp onto each image so I can see the time of each image in the resulting animation:

mogrify -fill white -stroke black -font Arial -pointsize 36 -gravity SouthWest -annotate 0 “{file} – {T2}” “{FILE}”

Robin

— comment by Robin Cottiss on February 9th, 2012 at 1:42am JST (4 years ago) comment permalink

i would like to be able to digimarc photos on export using your direct to smugmug plugin (via temporary files). is it possible to do that using a photoshop droplet (app) with your “run any command” post process filter? thank you for your plugins!

Lee

Yes, seems reasonable. I’ve heard folks run Droplets from “Run Any Command” successfully. —Jeffrey

— comment by Lee on September 13th, 2013 at 1:56am JST (2 years, 5 months ago) comment permalink

i have tried to do this without success. if someone else has managed to do it on a Mac i would appreciate seeing how your command line was structured. my command line looks like this:

‘/Volumes/MacPro RS2/Documents_RS2/Photoshop Actions/Digi 800px.app’ ‘{FILE}’

http://tinyurl.com/lfw7tfy

Lee

You probably want this:  open -a /Volumes/MacPro RS2/Documents_RS2/Photoshop Actions/Digi 800px.app' '{FILE}'  —Jeffrey

— comment by Lee on September 13th, 2013 at 12:12pm JST (2 years, 5 months ago) comment permalink

that worked! thank you.

if i understand this “filter” correctly though, the process only happens after the upload to smugmug. is there a way to make it happen to the image before going to smugmug (only choice seems to be to export to disk first — adding the digimarc — then upload to smugmug from the disk copy.

Lee

If you use it with the SmugMug plugin, it’ll happen before the upload, but you’ve got to make sure you update the image in place. —Jeffrey

— comment by Lee on September 13th, 2013 at 11:48pm JST (2 years, 5 months ago) comment permalink

Would it be possible to add a feature that would let you run a command after the ENTIRE export is done?

Let say : run a bash script on the folder that ZIP’s everything. Or run a script that would FTP the entire folder?

That’s already there, both in the run-any-command plugin and in the vanilla Lightroom export. —Jeffrey

— comment by Gerard Henninger on October 13th, 2013 at 8:55am JST (2 years, 4 months ago) comment permalink

Does this plugin work with LR Publish Services (such as jf Flickr)? I’m attempting to do some exiftool post-processing on images prior to publishing them to Flickr (e.g. remove/update CreateDate, CreateTime, etc.), but the capture time for the image on Flickr is set to the original photo’s capture time.

Yes, it gets control of the copy of the image that Lightroom creates for the export, before the overally controlling plugin (e.g. Flickr plugin) gets it. —Jeffrey

— comment by Sol on December 12th, 2013 at 6:45am JST (2 years, 2 months ago) comment permalink

From Portugal.

Is there any chance of running a command immediately activated when a shoot if made on studio as the file enters on the LR workspace? A kind of listener ignition to run a command…

I want to do 2 things:

1- on each image raw entered, read some of the xmp properties and compare to the ones approved by me (to detect camera wrong configuration);

2- do the same to small video files (first extract xml with exifTool using command and then reading properties and comparing with the approved ones;

The approved values depend on the studio, and on me and are to loaded from an xml.

At the end of all this, the photographer should be immediately warned if camera is not write configured, avoiding major mistakes that could not be corrected after.

Lightroom offers no on-import hooks for plugins. The only thing I could suggest would be to use my folder-watch plugin along with its method to do automatic export, there having a run-any-command entry check the metadata as you want. Very kludgy, but possible. —Jeffrey

— comment by Pedro Marques on January 18th, 2014 at 6:24pm JST (2 years ago) comment permalink

Jeffery,

i use the command as shown below, to set the file modified date:

touch -am -t ‘{YYYY}{MM}{DD}{HH}{MIN}.{SS}’ ‘{FILE}’

but this command only works for image file, video files do not take any effect.

do you have any idea to make it works for video files?

thank you.

It seems to work for me. Perhaps send a plugin log for a sample export. —Jeffrey

— comment by cupuno on January 27th, 2015 at 10:22pm JST (1 year ago) comment permalink

Can this be used to run a Python script on images after they are exported?

Yes, it can execute anything you can execute from the command line. —Jeffrey

— comment by Paul on January 30th, 2016 at 1:07am JST (1 week, 1 day ago) comment permalink