Lightroom Classic SDK — Safe, unattended batch import using Add mode
Hi everyone,
I'm a wedding photographer currently developing a macOS application to automate parts of the post-shoot ingestion and backup workflow, including Lightroom Classic catalogue preparation.
I've been experimenting with the Lightroom Classic SDK (16.0) using Lightroom Classic 16.0.1.
We've successfully tested two programmatic import approaches:
-
LrCatalog:addPhoto() -
LrCatalog:triggerImportFromPathWithPreviousSettings()
Both approaches work in our testing, but the native batch import is considerably faster.
In preliminary tests with 100 RAW photographs:
-
Individual SDK imports using
addPhoto()took approximately 112–115 seconds. -
A manual native Add import took approximately 5 seconds.
-
The SDK-triggered native import made all 100 expected photographs visible in the catalogue in approximately 3.8 seconds.
These were preliminary tests rather than a controlled performance benchmark, and the last measurement does not necessarily indicate that all background import operations had completed.
The challenge is that our workflow requires photographs to remain in their existing, verified storage locations. Lightroom must always use Add mode and must never inadvertently move, copy, rename or convert the original files.
We've investigated the saved AgImport_importBehavior preference and identified the values corresponding to Add, Copy, Move and Copy as DNG. However, we've observed that the saved preference and the currently selected import mode do not necessarily match at all times.
We therefore haven't established whether reading this preference is sufficient to guarantee the behaviour of triggerImportFromPathWithPreviousSettings().
My questions are:
-
Is there a supported SDK method for triggering native batch import while explicitly enforcing Add mode?
-
Which import settings does
triggerImportFromPathWithPreviousSettings()actually inherit, and is there a supported way to control them? -
Is there a reliable SDK callback or other supported mechanism for detecting when a native import has completed, failed or been cancelled?
-
Is there an alternative recommended approach for efficiently adding hundreds or thousands of existing photographs to a catalogue programmatically?
Ideally, the process would run unattended, without requiring the photographer to interact with the import dialogue.
We're currently retaining addPhoto() as a reliable fallback, but would very much like to benefit from the performance of Lightroom's native batch import.
We're deliberately avoiding direct catalogue database manipulation, undocumented preference modifications and fragile UI automation.
I'd be grateful for any guidance from Adobe engineers or experienced Lightroom plug-in developers who have encountered similar requirements.
Many thanks!
