• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Import images to Lightroom via command line?

New Here ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

Is it possible to import images to Lightroom using the command line?

 

(I'm a developer and writing a Mac Automator script for myself, to handle tasks that Lightroom's import can't do--e.g. renaming file by a unique camera Id, updating the metadata.)

TOPICS
macOS , SDK

Views

940

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 18, 2021 Aug 18, 2021

"Is it possible to import images to Lightroom using the command line?"

 

Not directly, but you could implement it using the LR plugin SDK to implement a plugin:

 

- The plugin has a URL handler that responds to URLs of the form:

 

lightroom://com.myname.myplugin/path1,path2,...,pathn

 

- The URL handler calls catalog:addPhoto() to import the files passed as arguments in the URL to the catalog.

 

- Use "curl" or "wget" to invoke the URL from the command line.

 

While this would only be about 20 l

...

Votes

Translate

Translate
LEGEND ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

"Is it possible to import images to Lightroom using the command line?"

 

Not directly, but you could implement it using the LR plugin SDK to implement a plugin:

 

- The plugin has a URL handler that responds to URLs of the form:

 

lightroom://com.myname.myplugin/path1,path2,...,pathn

 

- The URL handler calls catalog:addPhoto() to import the files passed as arguments in the URL to the catalog.

 

- Use "curl" or "wget" to invoke the URL from the command line.

 

While this would only be about 20 lines of code, the learning curve for the SDK is steep, even for experienced programmers, more so if you don't know Lua or Scheme. The concepts above are discussed in the LR SDK Programmers Guide.  Expect to take at least 6-10 hours minimum.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

Thank you for explaining. That helps me understand, even though it doesn't sound easy.

 

Just so I understand: how would my script invoke the `lightroom://...` URL? Via calling `open  lightroom://...` in a terminal shell? (Source: Mac's open command.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

You could use "open", "wget", or "curl" to invoke the lightroom: URL.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

LATEST

thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines