Skip to main content
areohbee
Legend
November 26, 2013
Answered

Restarting Lightroom - how to do it *and* have preferences saved (& start up with specified catalog)

  • November 26, 2013
  • 1 reply
  • 5711 views

I know one way to restart Lightroom (with specified catalog), however preferences are not saved:

Win: lightroom.exe -restart {catalog}

Mac: open {catalog}

However sometimes (usually) it would be better if preferences were saved on the way out.

PS - I can exit Lightroom with preferences saved by stuffing the keyboard (Alt/Cmd-FX), but how to get it to startup again (with specified catalog).

Any ideas?

Rob

This topic has been closed for replies.
Correct answer areohbee

Yeah, I didn't explain my thoughts too clearly.  I think you have to write a batch file killandrestart.bat that contains:

taskkill /im lightroom.exe

lightroom.exe -restart catalog

and you may have to run that batch file from the plugin using the command line:

start killandstart.bat

Otherwise, the "taskkill" might kill LR, and thus its child processes, including the CMD.EXE running killandrestart.bat, before the restart of LR is executed. 



Thanks John - big time !

I got it working with bat:

taskkill /im lightroom.exe /t

lightroom.exe catalog

Notes:

* /t was necessary

* -restart must be omitted.

Actual text of bat file:

taskkill /im lightroom.exe /t
"C:\Program Files\Adobe\Adobe Photoshop Lightroom 5.2\lightroom.exe" %1

A big thanks again to John - you're my hero .

Rob

1 reply

johnrellis
Legend
November 26, 2013

Before invoking those commands to start LR on a catalog, politely terminate the application:


Windows: taskkill /im lightroom.exe

Mac: osascript -e 'tell application "Adobe Photoshop LIghtroom 5" to quit'

These send a "quit" event to the application.  A quickie experiment indicates that LR does indeed save its preferences before terminating, but you should definitely test it more thoroughly.

(I knew the Windows solution immediately, but had to Google the Mac one after discovering the Unix "kill pid" isn't trapped by Mac apps.)

If you're invoking these as shell scripts from a plugin, I think you might have to do some more magic to ensure that the shell script doesn't terminate immediately after it kills its parent (the LR process).  On Windows, I think (but not positive) the following would work:

start killandrestart.bat

On Unix, I think the magic is:

nohup killandrestart.sh &

but I haven't tried it on Mac OS.

areohbee
areohbeeAuthor
Legend
November 26, 2013

John R. Ellis wrote:

Windows: taskkill /im lightroom.exe

I tried this, but then the command to restart seems to fall on deaf ears (issued via plugin, not a .bat file) - it terminates with prefs saved alright, but then doesn't start back up. - hmm...

johnrellis
Legend
November 26, 2013

Yeah, I didn't explain my thoughts too clearly.  I think you have to write a batch file killandrestart.bat that contains:

taskkill /im lightroom.exe

lightroom.exe -restart catalog

and you may have to run that batch file from the plugin using the command line:

start killandstart.bat

Otherwise, the "taskkill" might kill LR, and thus its child processes, including the CMD.EXE running killandrestart.bat, before the restart of LR is executed.