Class LrExportSession

This class provides access to a list of photos to be exported and the renditions of those photos to be generated during an export operation.
  • Use the imported namespace as a constructor; access the functions through the created objects.
  • An object is also available from the exportContext.exportSession property.

Summary

LrExportSession( params )
Creates an export session object.
Reports the number of renditions that will be generated by this session.
Creates all of the renditions specified by this export session.
Starts rendering photos in a new asynchronous task.
Creates an iterator with which to walk the list of photos to be exported.
Removes all renditions for a photo from the export session.
Creates an iterator with which to walk the list of renditions generated for this session's photos.
Creates an iterator with which to walk an export filter's renditions-to-satisfy list.
(LrCatalog) The catalog object for this export session.

Functions

LrExportSession( params )
Creates an export session object. The session acts on a specific set of photos and settings, as when a session is started in the Export dialog.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. params
(table) Arguments in named-argument syntax. All are required.
  • photosToExport (array of LrPhoto) A set of photos to be exported in this session.
  • exportSettings (table) A set of export settings for this session, as generated by the Export dialog.

Return value

An exportSession object.

See also

LrCatalog, LrPhoto
exportSession:countRenditions()
Reports the number of renditions that will be generated by this session.

First supported in version 1.3 of the Lightroom SDK.

Return value

(number) The number of renditions.
exportSession:doExportOnCurrentTask()
Creates all of the renditions specified by this export session. This function must be called from an asynchronous task. This task blocks until all renditions are created.

First supported in version 1.3 of the Lightroom SDK.

See also

LrTasks
exportSession:doExportOnNewTask()
Starts rendering photos in a new asynchronous task. It is safe to call this function whether in a task or not. This function returns immediately; it does not wait for rendering to complete.

First supported in version 1.3 of the Lightroom SDK.

See also

LrTasks
exportSession:photosToExport()
Creates an iterator with which to walk the list of photos to be exported. Use to wrap a loop that processes each photo.

First supported in version 1.3 of the Lightroom SDK.

For example:

 for photo in exportSession:photosToExport() do 
    -- (do something with photo)
end

See also

LrPhoto
exportSession:removePhoto( photo )
Removes all renditions for a photo from the export session. It is safe to call this function while using the photosToExport() iterator. However, if you remove a photo that has not been seen yet by the iterator, the iterator still reports that photo.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. photo
(LrPhoto) The photo to remove.

See also

LrPhoto
exportSession:renditions( params )
Creates an iterator with which to walk the list of renditions generated for this session's photos. Use to wrap a function that processes each rendition; the function is called on an LrRendition for each photo in turn.

First supported in version 1.3 of the Lightroom SDK.

For example:

 for rendition in exportSession:renditions() do
    -- (do something with rendition)
end

Parameters

1. params
(table, optional) Arguments in named argument syntax; all arguments are optional.
  • exportContext (LrExportContext): An export context.
  • progessScope (LrProgressScope): A progress scope.
  • renderProgressPortion (number): Percentage completion for progress scope when done, [0..1].
  • stopIfCanceled (Boolean): True to stop the iterator prematurely if progress scope is canceled.

See also

LrExportRendition, LrExportContext, LrProgressScope
exportSession:renditionsForFilter( params )
Creates an iterator with which to walk an export filter's renditions-to-satisfy list. The iterator generates a rendition from this export session (that is, before the application of this filter) and matches it with the corresponding rendition to be satisfied by the filter.

First supported in version 2.0 of the Lightroom SDK.

For example:

 for sourceRendition, renditionToSatisfy in exportSession:renditionsForFilter( params ) do
    -- (do something with rendition)
end

Parameters

1. params
(table, optional) Arguments in named argument syntax.
  • plugin (_PLUGIN object)
  • renditionsToSatisfy (array of LrExportRendition): The list of renditions that this filter must satisfy.
  • filterSettings (function, optional): If present, this function can alter the export settings of the rendition. It is called with two arguments: the individual rendition to be satisfied, and a copy of its export settings that can be modified in place. It can optionally return a string, which will be used as the new path to the file.

See also

LrExportRendition, LrProgressScope

Properties

exportSession.catalog : (Read-Only)
(LrCatalog) The catalog object for this export session.

First supported in version 1.3 of the Lightroom SDK.

See also: LrCatalog