### LrCatalog:triggerImportUI Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Triggers the import UI, optionally pre-selecting a source directory. ```Lua catalog:triggerImportUI( path ) ``` -------------------------------- ### LrSystemInfo.memSize() Source: https://lrc.mcor.dev/modules/LrSystemInfo.html Reports the amount of physical RAM installed on the host computer. ```APIDOC ## LrSystemInfo.memSize() ### Description Reports the amount of physical RAM installed on the host computer. ### Return value (number) Size of physical memory in bytes. ``` -------------------------------- ### LrCatalog:type Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Reports the type of the catalog object. ```Lua catalog:type() ``` -------------------------------- ### LrCatalog:updateAISettings Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Updates AI Settings for a set of photos. Must be called within a write access gate. If no photos are passed, it updates for all target photos. ```Lua catalog:updateAISettings( photos ) ``` -------------------------------- ### LrCatalog:setPropertyForPlugin Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Sets a plug-in-specific metadata value for the catalog. This must be called within a write access gate. ```Lua catalog:setPropertyForPlugin( plugin, fieldId, value ) ``` -------------------------------- ### Example Usage of LrSocket Source: https://lrc.mcor.dev/modules/LrSocket.html Demonstrates how to import and use the LrSocket namespace to bind a 'send' mode socket, send a message, and manage the connection lifecycle within an asynchronous task. ```lua local LrSocket = import "LrSocket" local LrTasks = import "LrTasks" import "LrTasks".startAsyncTask( function() LrFunctionContext.callWithContext( 'socket_remote', function( context ) local running = true local sender = LrSocket.bind { functionContext = context, port = 0, -- (let the OS assign the port) mode = "send", onConnecting = function( socket, port ) -- TODO end, onConnected = function( socket, port ) -- TODO end, onMessage = function( socket, message ) -- nothing, we don't expect to get any messages back from a send port end, onClosed = function( socket ) running = false end, onError = function( socket, err ) if err == "timeout" then socket:reconnect() end end, } sender:send( "Hello world" ) while running do LrTasks.sleep( 1/2 ) -- seconds end sender:close() end ) end ) ``` -------------------------------- ### LrCatalog:setViewFilter Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Sets the library view filter programmatically. Accepts a filter preset string or a table of filter values. ```Lua catalog:setViewFilter( filter ) ``` -------------------------------- ### Example Placeholder String Source: https://lrc.mcor.dev/modules/LrView%20edit%20view%20properties.html Sets a placeholder string for an LrView edit field. This text is displayed until the user enters a value or focuses on the item. ```lua placeholder_string = "Enter your new value here" ``` -------------------------------- ### LrCatalog:setSelectedPhotos Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Sets the photo selection programmatically. Requires the active photo and a table of other selected photos. ```Lua catalog:setSelectedPhotos( activePhoto, otherSelectedPhotos ) ``` -------------------------------- ### Start Export on New Task Source: https://lrc.mcor.dev/modules/LrExportSession.html Initiates the rendering of photos in a new, separate asynchronous task. This function returns immediately without waiting for the export to complete, allowing the main task to continue. ```Lua exportSession:doExportOnNewTask() ``` -------------------------------- ### LrTasks.startAsyncTask(func, optName) Source: https://lrc.mcor.dev/modules/LrTasks.html Start a function that will run as a cooperative task on Lightroom's main thread. If an error is thrown while this task is executing, shows a standard error dialog. ```APIDOC ## LrTasks.startAsyncTask( func, optName ) ### Description Start a function that will run as a cooperative task on Lightroom's main thread. If an error is thrown while this task is executing, shows a standard error dialog. ### Parameters 1. func (function) The function to start. 2. optName (string, optional) A name to assign to the task, for debugging only. ### See also LrFunctionContext.postAsyncTaskWithContext ``` -------------------------------- ### exportContext:startRendering Source: https://lrc.mcor.dev/modules/LrExportContext.html Starts the rendering process in a separate task. This method is called internally by `renditions()` if the rendering process has not yet begun. ```APIDOC ## exportContext:startRendering ### Description Starts the rendering process in a separate task. First supported in version 1.3 of the Lightroom SDK. ``` -------------------------------- ### LrCatalog:triggerImportFromPathWithPreviousSettings Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Triggers an import from a specified path, using settings from the most recent import without showing the import dialog. ```Lua catalog:triggerImportFromPathWithPreviousSettings( path ) ``` -------------------------------- ### catalog:getChildCollectionSets Source: https://lrc.mcor.dev/modules/LrCatalog.html Retrieves the top-level collection sets in this catalog. Does not get nested sets. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ```APIDOC ## catalog:getChildCollectionSets() ### Description Retrieves the top-level collection sets in this catalog. Does not get nested sets. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ### Return value (array of `LrCollectionSet`) The collection set objects. ``` -------------------------------- ### Get Rating Source: https://lrc.mcor.dev/modules/LrSelection.html Retrieves the rating of the current selection. ```APIDOC ## LrSelection.getRating() ### Description Returns the rating of the selection as a number (0-5). ### Method APIDOC ### Endpoint LrSelection.getRating ``` -------------------------------- ### LrFunctionContext.pcallWithEmptyEnvironment Source: https://lrc.mcor.dev/modules/LrFunctionContext.html Runs the main function in a safe environment, catching any exceptions that occur. ```APIDOC ## LrFunctionContext.pcallWithEmptyEnvironment ### Description Runs the main function in a known-safe function environment, catching any exceptions that occur. ### Signature LrFunctionContext.pcallWithEmptyEnvironment( func, ... ) ``` -------------------------------- ### LrFunctionContext.pcallWithEnvironment Source: https://lrc.mcor.dev/modules/LrFunctionContext.html Runs the main function in a provided environment, catching any exceptions. ```APIDOC ## LrFunctionContext.pcallWithEnvironment ### Description Runs the main function in a caller-provided function environment, catching any exceptions that occur. ### Signature LrFunctionContext.pcallWithEnvironment( func, env, ... ) ``` -------------------------------- ### getValue Source: https://lrc.mcor.dev/modules/LrDevelopController.html Gets the current value of a specified Develop adjustment for the photo. ```APIDOC ## getValue ### Description Gets the value of a Develop adjustment for the current photo. ### Method Invoke ### Parameters - **param** (string) - Required - The parameter of the adjustment to get the value for. ``` -------------------------------- ### LrApplication.developPresetFolders() Source: https://lrc.mcor.dev/modules/LrApplication.html Retrieves all defined develop preset folders. ```APIDOC ## LrApplication.developPresetFolders() ### Description Retrieves all defined develop preset folders. ### Method N/A (Function Call) ### Response #### Success Response - **folders**: (array) - An array of develop preset folder objects. ``` -------------------------------- ### getRange Source: https://lrc.mcor.dev/modules/LrDevelopController.html Gets the minimum and maximum values for a specified Develop adjustment. ```APIDOC ## getRange ### Description Gets the min and max value of a Develop adjustment. ### Method Invoke ### Parameters - **param** (string) - Required - The parameter of the adjustment to get the range for. ``` -------------------------------- ### LrTether.startTether Source: https://lrc.mcor.dev/modules/LrTether.html Initiates a tethered capture session. ```APIDOC ## LrTether.startTether ### Description Starts a tethered capture session. ### Method LrTether.startTether() ``` -------------------------------- ### Get Flag Source: https://lrc.mcor.dev/modules/LrSelection.html Retrieves the pick flag state of the active photo. ```APIDOC ## LrSelection.getFlag() ### Description Returns the pick flag state of the active photo as a number (-1 = reject, 0 = none, 1 = pick). ### Method APIDOC ### Endpoint LrSelection.getFlag ``` -------------------------------- ### LrCatalog:withPrivateWriteAccessDo Example Source: https://lrc.mcor.dev/modules/LrCatalog.html Provides write access to custom fields for a plugin, bypassing the undo stack. The callback function receives a context that expires upon completion. ```Lua catalog:withPrivateWriteAccessDo( function( context ) -- do something that reads or writes catalog end ) ``` -------------------------------- ### LrTether.numDownloadsPending Source: https://lrc.mcor.dev/modules/LrTether.html Gets the number of photos that are currently being downloaded from the tethered camera. ```APIDOC ## LrTether.numDownloadsPending ### Description Returns the number of photos currently being downloaded from the tethered camera. ### Method LrTether.numDownloadsPending() ### Return Value (number) The number of photos currently being downloaded from a tethered capture. ``` -------------------------------- ### Create Directories Recursively Source: https://lrc.mcor.dev/modules/LrFileUtils.html Creates a directory at the specified path, including any necessary parent directories. Returns true on success or if directories already exist, false on error. ```Lua LrFileUtils.createAllDirectories( path ) ``` -------------------------------- ### Example Action Binding for Modal Dialog Source: https://lrc.mcor.dev/modules/LrDialogs.html Demonstrates how to bind an action button's enabled state to a property in a modal dialog. This is useful for controlling button interactivity based on application state. ```lua actionBinding = { enabled = { bind_to_object = props, key = 'actionEnabled' } } ``` -------------------------------- ### Create Optimized Formatted Log Functions (logger:quickf) Source: https://lrc.mcor.dev/modules/LrLogger.html Use `logger:quickf` to create optimized log functions that accept `string.format` instructions. This is ideal for performance-sensitive code where log messages require dynamic formatting. ```lua local warnf, infof = logger:quickf( 'warn', 'info' ) warnf( 'something %s happened', 'bad' ) ``` -------------------------------- ### Get Color Label Source: https://lrc.mcor.dev/modules/LrSelection.html Retrieves the color label assigned to the active photo. ```APIDOC ## LrSelection.getColorLabel() ### Description Returns the color label assigned to the active photo, one of: "red", "yellow", "green", "blue", "purple", or "none". ### Method APIDOC ### Endpoint LrSelection.getColorLabel ``` -------------------------------- ### photo:quickDevelopSetTreatment Source: https://lrc.mcor.dev/modules/LrPhoto.html Sets the Treatment for the current photo. Supported treatments include 'color' or 'grayscale'. ```APIDOC ## photo:quickDevelopSetTreatment(value) ### Description Sets the Treatment for the current photo. ### Parameters #### Path Parameters * **value** (string) - Required - Can be "color" or "grayscale". ### Method Not applicable (SDK function) ``` -------------------------------- ### LrApplication.versionString Source: https://lrc.mcor.dev/modules/LrApplication.html Retrieves the current version of the application as a user-displayable string, for example, '2.0'. ```APIDOC ## LrApplication.versionString ### Description Retrieves the current version of the application as a user-displayable string (for instance, "2.0"). ### Return value (string) Lightroom version First supported in version 2.0 of the Lightroom SDK. ``` -------------------------------- ### LrApplication.developPresetFolders Source: https://lrc.mcor.dev/modules/LrApplication.html Retrieves all defined develop preset folders. ```APIDOC ## LrApplication.developPresetFolders() ### Description Retrieves all defined develop preset folders. ### Return value (array of `LrDevelopPresetFolder`) The preset folder objects. ``` -------------------------------- ### createAllDirectories Source: https://lrc.mcor.dev/modules/LrFileUtils.html Creates a directory at a given path, recursively creating any parent directories that do not already exist. ```APIDOC ## createAllDirectories ### Description Creates a directory at the specified path, including any necessary parent directories. ### Parameters #### Path Parameters - **path** (string) - Required - The path of the directory to create. ``` -------------------------------- ### Create Directory Source: https://lrc.mcor.dev/modules/LrFileUtils.html Creates a single directory at the specified path. The parent directory must already exist. Use this when you are certain the parent path is already in place. ```Lua LrFileUtils.createDirectory( path ) ``` -------------------------------- ### LrPathUtils.parent Source: https://lrc.mcor.dev/modules/LrPathUtils.html Retrieves the parent directory of a given path. For example, the parent of '/a/b/c' is '/a/b'. ```APIDOC ## LrPathUtils.parent ### Description Retrieves the parent directory of a path. ### Parameters * **path** (string) - The path whose parent directory is to be retrieved. ### Returns (string) - The parent directory path. ``` -------------------------------- ### LrHttp.get Source: https://lrc.mcor.dev/modules/LrHttp.html Retrieves data over the network using HTTP or HTTPS GET. Supports custom headers and timeouts. ```APIDOC ## LrHttp.get ### Description Retrieves data over the network using HTTP or HTTPS GET. ### Method GET ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Parameters 1. url (string) - The URL to get. 2. headers (table, optional) - A table of tables, one for each header. Each header table has a 'field' and a 'value' entry. Unless you specify a 'Content-Type' header, Lightroom will add such a header with a value of 'text/plain'. To force the omission of a 'Content-Type' header, specify a 'Content-Type' header with a value of 'skip'. 3. timeout (number) - The length of time (in seconds) to wait during each phase of the connection before canceling the request. This parameter will be ignored by Lightroom 1.3 and 1.4. ### Return values 1. (string) The body of the HTTP response. 2. (table) A table of tables, one for each header. Each header table has a 'field' and a 'value' entry. The headers table contains the key "status" whose value is the HTTP status (an integer). Cookies are stored in a 'Set-Cookie' header; there can be multiple 'Set-Cookie' headers. ### See also LrHttp.parseCookie ``` -------------------------------- ### LrSystemInfo.summaryString() Source: https://lrc.mcor.dev/modules/LrSystemInfo.html Returns a summary of system information. ```APIDOC ## LrSystemInfo.summaryString() ### Description Returns a summary of system information. Use only for reporting purposes. Do not attempt to parse this string. ### Return value (string) A string description of the system information, such as "Microsoft Windows XP Professional Service Pack 3 (Build 2600) (x86)". ``` -------------------------------- ### Retrieving Current Language Source: https://lrc.mcor.dev/modules/LrLocalization.html Shows how to get the two-letter ISO code for the currently active language in Lightroom. ```javascript var currentLang = LrLocalization.currentLanguage(); ``` -------------------------------- ### preset:getSetting() Source: https://lrc.mcor.dev/modules/LrDevelopPreset.html Retrieves the develop settings for the preset. Note: These APIs are experimental. ```APIDOC ## preset:getSetting() ### Description Retrieves the settings for this preset. ### Return value (table) The develop settings table. Contains various members like AutoBrightness, Brightness, Contrast, etc. ``` -------------------------------- ### LrSelection.removeFromCatalog Source: https://lrc.mcor.dev/modules/LrSelection.html Removes the selected photos from the catalog. This function is available starting from version 14.3 of the Lightroom SDK. ```APIDOC ## LrSelection.removeFromCatalog ### Description Removes the selection from the catalog. ### Method (Not specified, assumed to be a direct function call) ### Endpoint (Not applicable, SDK function) ### Parameters None ### Response None explicitly documented. ``` -------------------------------- ### LrApplication.purchaseSource() Source: https://lrc.mcor.dev/modules/LrApplication.html Returns a string identifying the manner in which the Lightroom instance was obtained. ```APIDOC ## LrApplication.purchaseSource() ### Description Returns a string identifying the manner in which the Lightroom instance was obtained. ### Method N/A (Function Call) ### Response #### Success Response - **source**: (string) - The purchase source string. ``` -------------------------------- ### LrSelection.decreaseRating Source: https://lrc.mcor.dev/modules/LrSelection.html Decreases the rating of the selected photos. This function is available starting from version 6.0 of the Lightroom SDK. ```APIDOC ## LrSelection.decreaseRating ### Description Decreases the rating of the selection. ### Method (Not specified, assumed to be a direct function call) ### Endpoint (Not applicable, SDK function) ### Parameters None ### Response None explicitly documented. ``` -------------------------------- ### LrMD5.digest Source: https://lrc.mcor.dev/modules/LrMD5.html Creates an MD5 digest from a string. This function is available starting from version 1.3 of the Lightroom SDK. ```APIDOC ## LrMD5.digest ### Description Creates an MD5 digest from a string. ### Method LrMD5.digest ### Parameters #### Parameters - **data** (string) - Required - The string to digest. ### Return value (string) - The MD5 digest of the string. ``` -------------------------------- ### folder:type() Source: https://lrc.mcor.dev/modules/LrDevelopPresetFolder.html Reports the type of this object. This function is supported starting from version 4.1 of the Lightroom SDK. ```APIDOC ## folder:type() ### Description Reports the type of this object. ### Parameters None ### Return value (string) 'LrDevelopPresetFolder'. ### Supported in SDK version 4.1 ``` -------------------------------- ### photo:buildSmartPreview Source: https://lrc.mcor.dev/modules/LrPhoto.html Creates a smart preview for the photo. Does nothing for video. This function must be called within an asynchronous task. ```APIDOC ## photo:buildSmartPreview ### Description Creates a smart preview for the photo. Does nothing for video. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 5.0 of the Lightroom SDK. ### Return value (string) A string indicating the result: 'created' if a smart preview was built, 'existed' if a smart preview already existed, 'failed' if smart preview creation failed, e.g. when invoked on a video object. ``` -------------------------------- ### folder:getPath() Source: https://lrc.mcor.dev/modules/LrDevelopPresetFolder.html Retrieves the path of this folder. This function is supported starting from version 3.0 of the Lightroom SDK. ```APIDOC ## folder:getPath() ### Description Retrieves the path of this folder. ### Parameters None ### Return value (string) The path. ### Supported in SDK version 3.0 ``` -------------------------------- ### createDirectory Source: https://lrc.mcor.dev/modules/LrFileUtils.html Creates a directory at a given path. ```APIDOC ## createDirectory ### Description Creates a directory at the specified path. ### Parameters #### Path Parameters - **path** (string) - Required - The path of the directory to create. ``` -------------------------------- ### folder:getName() Source: https://lrc.mcor.dev/modules/LrDevelopPresetFolder.html Retrieves the name of this folder. This function is supported starting from version 3.0 of the Lightroom SDK. ```APIDOC ## folder:getName() ### Description Retrieves the name of this folder. ### Parameters None ### Return value (string) The name. ### Supported in SDK version 3.0 ``` -------------------------------- ### builderInstance:beginBlock Source: https://lrc.mcor.dev/modules/LrXml.html Adds an XML opening tag to the document being built. ```APIDOC ## builderInstance:beginBlock ### Description Adds an XML opening tag to this XML document. ### Parameters #### Query Parameters - **name** (string) - Required - The name of the XML block. - **attributes** (table) - Optional - A table of attributes for the XML block. ``` -------------------------------- ### folder:getDevelopPresets() Source: https://lrc.mcor.dev/modules/LrDevelopPresetFolder.html Retrieves the develop-preset children of this folder. This function is supported starting from version 3.0 of the Lightroom SDK. ```APIDOC ## folder:getDevelopPresets() ### Description Retrieves the develop-preset children of this folder. ### Parameters None ### Return value (array of `LrDevelopPreset`) The develop-preset objects. ### Supported in SDK version 3.0 ``` -------------------------------- ### LrFileUtils.createAllDirectories Source: https://lrc.mcor.dev/modules/LrFileUtils.html Creates a directory at the specified path, recursively creating any parent directories that are missing. Returns true on success or false if errors occur. ```APIDOC ## LrFileUtils.createAllDirectories ### Description Creates a directory at a given path, recursively creating any parent directories that do not already exist. First supported in version 1.3 of the Lightroom SDK. ### Parameters 1. path (string) The path of the new directory. ### Return values 1. (Boolean) True if there were no errors, false if there were errors creating directories in the path. 2. (string or Boolean) A string describing the error if there were errors creating directories; otherwise, true if one or more directories were created, or false if all the directories already existed. ``` -------------------------------- ### Batch Get Formatted Metadata Source: https://lrc.mcor.dev/modules/LrCatalog.html Retrieves display-formatted metadata for multiple photos. The returned strings are intended for display and should not be parsed. ```lua result = { [ LrPhoto #1 ] = { fileName = "filename_1.jpg", rating = 3, }, [ LrPhoto #2 ] = { fileName = "filename_2.jpg", rating = 5, }, } ``` -------------------------------- ### LrFunctionContext.pcallWithEmptyEnvironment Source: https://lrc.mcor.dev/modules/LrFunctionContext.html Runs a function in a safe, empty environment, catching any exceptions. It's equivalent to setting the environment to an empty table and then calling pcall. ```APIDOC ## LrFunctionContext.pcallWithEmptyEnvironment ### Description Runs the main function in a known-safe function environment, catching any exceptions that occur. Equivalent to `setfenv( func, {} ); return pcall( func, ... )`. The passed-in function is subjected to string.dump for safety reasons, so any variables declared in the scope of the calling function are not automatically passed through to the inner function. In particular, imported namespaces and classes do not carry through. First supported in version 3.0 of the Lightroom SDK. ### Parameters 1. func (function) The main function to call, with an empty environment. 2. ... (any) Further arguments are passed through to the function. ### Return values 1. (Boolean) True if the call succeeded, false if an error occurred 2. (any) The call results; that is, whatever is returned from the main function. ``` -------------------------------- ### ftpConnection:getContents Source: https://lrc.mcor.dev/modules/LrFtp.html Retrieves the contents of a file or directory on the remote server. Can be used to get file data or a directory listing. ```APIDOC ## ftpConnection:getContents( remoteFileName ) ### Description Retrieves the contents of a file or directory on the remote server and returns it as a string. If the remote name is a path separator character ('/'), a file listing for the current `ftpConnection.path` will be returned. This method must be called from within an asynchronous task started by `LrTasks`. Throws an exception in the event of an error. First supported in version 1.3 of the Lightroom SDK. ### Parameters 1. `remoteFileName` (string) - The remote file name, or a path separator character ('/'). To specify the containing directory, set the `ftpConnection.path` property to the name of an existing directory. ### Return value (string) The contents of the remote file, or the file listing for the FTP connection's path. ``` -------------------------------- ### LrApplicationView.fullscreenPreview() Source: https://lrc.mcor.dev/modules/LrApplicationView.html Changes the screen mode to Full Screen Preview. ```APIDOC ## LrApplicationView.fullscreenPreview() ### Description Changes the screen mode to Full Screen Preview. ### Method APIDOC ### Endpoint LrApplicationView.fullscreenPreview() ``` -------------------------------- ### ZString Format Example Source: https://lrc.mcor.dev/modules/LrLocalization.html Illustrates the standard format for a ZString, which includes a unique path, an identifier, and the English text value. ```plaintext "$$$/ZStringPath/StringKey=This is the English text value" ``` -------------------------------- ### LrDevelopPresetFolder Source: https://lrc.mcor.dev/index.html Provides access to a develop-preset folder, and to the LrDevelopPreset objects for the contained presets. ```APIDOC ## LrDevelopPresetFolder (Class) ### Description This class provides access to a develop-preset folder, and to the LrDevelopPreset objects for the contained presets. ### Usage Obtain namespaces using Lightroom Classic's built-in `import` function. For some classes, import the namespace and use the constructor to create objects; other objects can only be obtained through other API functions, as described in the documentation for each class. ``` -------------------------------- ### photo:getRawMetadata Source: https://lrc.mcor.dev/modules/LrPhoto.html Retrieves unformatted metadata from this photo. This function must be called from within a task started using `LrTasks`. ```APIDOC ## photo:getRawMetadata(key) ### Description Retrieves unformatted metadata from this photo. ### Parameters 1. **key** (string) - The key for the metadata property to retrieve. ``` -------------------------------- ### Get Export Session Type Source: https://lrc.mcor.dev/modules/LrExportSession.html Reports the type of the LrExportSession object. This is a simple utility function to identify the object's class. ```lua exportSession:type() ``` -------------------------------- ### LrShell.openPathsViaCommandLine Source: https://lrc.mcor.dev/modules/LrShell.html Opens one or more files via a command-line process. Paths must be provided in platform-specific syntax. ```APIDOC ## LrShell.openPathsViaCommandLine ### Description Opens one or more files via a command-line process. Paths must be provided in platform-specific syntax. ### Method LrShell.openPathsViaCommandLine( files, appPath, extraArgs ) ### Parameters 1. **files** (array of strings) - The paths to the files. 2. **appPath** (string) - The path to the command-line application. 3. **extraArgs** (optional, string) - Extra arguments to be inserted between the process name and first file path. ### Request Example ```lua LrShell.openPathsViaCommandLine( { "/Users/example/myLightroomPlugin.lrplugin/Info.lua" }, "/usr/bin/edit", "-w" ) ``` ### Return Value (number) The return code from the process (typically 0 if no error). In Windows, the return code from the final run of the process if it was split. ### Notes Windows has a maximum command line length limit. Lightroom may split large batches of files across multiple calls. The practical limit is lower than the documented 8000 characters, with Lightroom splitting commands exceeding 1500 characters. Mac OS does not appear to have this limit. Due to the implementation of `fork()` in Mac OS, multiple calls to this function are executed sequentially, even if run from separate tasks. This function was first supported in version 3.0 of the Lightroom SDK. ``` -------------------------------- ### LrApplicationView.gridView() Source: https://lrc.mcor.dev/modules/LrApplicationView.html Opens Grid View. ```APIDOC ## LrApplicationView.gridView() ### Description Opens Grid View. ### Method APIDOC ### Endpoint LrApplicationView.gridView() ``` -------------------------------- ### LrApplication.filenamePresets() Source: https://lrc.mcor.dev/modules/LrApplication.html Reports available file-naming presets. ```APIDOC ## LrApplication.filenamePresets() ### Description Reports available file-naming presets. ### Method N/A (Function Call) ### Response #### Success Response - **presets**: (array) - An array of file-naming preset objects. ``` -------------------------------- ### pubCollection:getService Source: https://lrc.mcor.dev/modules/LrPublishedCollection.html Retrieves the service that this collection belongs to. This function must be called from within an asynchronous task started using LrTasks. ```APIDOC ## pubCollection:getService ### Description Retrieves the service that this collection belongs to. ### Method (Implicitly called within an LrTasks context) ### Return Value (`LrPublishService`) The parent publish service object. ``` -------------------------------- ### LrApplicationView.switchToModule Source: https://lrc.mcor.dev/modules/LrApplicationView.html Switches between modules. ```APIDOC ## LrApplicationView.switchToModule ### Description Switches between modules. First supported in version 6.0 of the Lightroom SDK. ### Parameters #### Parameters - moduleName (string) - Required - The name of the module to activate, one of: "library", "develop", "map", "book", "slideshow", "print", "web". ``` -------------------------------- ### pubCollectionSet:getName Source: https://lrc.mcor.dev/modules/LrPublishedCollectionSet.html Retrieves the current name of this set. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## pubCollectionSet:getName() ### Description Retrieves the current name of this set. ### Method `pubCollectionSet:getName()` ### Notes - This function must be called from within an asynchronous task started using `LrTasks`. - First supported in version 3.0 of the Lightroom SDK. ### Return value (string) The name. ``` -------------------------------- ### photo:quickDevelopSetWhiteBalance Source: https://lrc.mcor.dev/modules/LrPhoto.html Sets the White Balance for the current photo. Supports various lighting conditions. ```APIDOC ## photo:quickDevelopSetWhiteBalance(value) ### Description Sets the White Balance for the current photo. ### Parameters #### Path Parameters * **value** (string) - Required - Can be "Auto", "Daylight", "Cloudy", "Shade", "Tungsten", "Fluorescent" and "Flash" as applicable to the image type. ### Method Not applicable (SDK function) ``` -------------------------------- ### LrExportSession Source: https://lrc.mcor.dev/modules/LrExportSession.html 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. ```APIDOC ## LrExportSession ### Description 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. ### Parameters #### Parameters - **params** (table) - Required - Arguments in named-argument syntax. All are required. * **photosToExport** (array of `LrPhoto`) - Required - A set of photos to be exported in this session. * **exportSettings** (table) - Required - A set of export settings for this session, as generated by the Export dialog. ### Return value An `exportSession` object. ### See also LrCatalog, LrPhoto ``` -------------------------------- ### collectionSet:getName Source: https://lrc.mcor.dev/modules/LrCollectionSet.html Retrieves the current name of this set. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## collectionSet:getName() ### Description Retrieves the current name of this set. ### Method (Implicitly a method call on an LrCollectionSet object) ### Parameters None ### Return value (string) The name. ### Notes This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ``` -------------------------------- ### LrSystemInfo.appWindowSize() Source: https://lrc.mcor.dev/modules/LrSystemInfo.html Reports the size of the main Lightroom application window. ```APIDOC ## LrSystemInfo.appWindowSize() ### Description Reports the size of the main Lightroom application window. ### Return values 1. (number) Width of Lightroom's main application window, in pixels 2. (number) Height of Lightroom's main application window, in pixels ``` -------------------------------- ### LrApplication.addDevelopPresetForPlugin() Source: https://lrc.mcor.dev/modules/LrApplication.html Adds a develop preset hidden within a plug-in. ```APIDOC ## LrApplication.addDevelopPresetForPlugin( plugin, presetName, presetValue ) ### Description Adds a develop preset hidden within a plug-in. ### Method N/A (Function Call) ### Parameters - **plugin**: (object) - The plugin object. - **presetName**: (string) - The name of the preset. - **presetValue**: (object) - The value of the preset. ``` -------------------------------- ### Batch Get Raw Metadata Source: https://lrc.mcor.dev/modules/LrCatalog.html Retrieves unformatted, raw metadata for multiple photos. This is useful for accessing metadata that is not intended for direct display. ```lua catalog:batchGetRawMetadata(photos, keys) ``` -------------------------------- ### LrApplication.developPresetByUuid() Source: https://lrc.mcor.dev/modules/LrApplication.html Retrieves a develop preset from its unique identifier. ```APIDOC ## LrApplication.developPresetByUuid( uuid ) ### Description Retrieves a develop preset from its unique identifier. ### Method N/A (Function Call) ### Parameters - **uuid**: (string) - The unique identifier of the develop preset. ### Response #### Success Response - **preset**: (object) - The develop preset object. ``` -------------------------------- ### Get File Attributes Source: https://lrc.mcor.dev/modules/LrFileUtils.html Retrieves attributes such as file size and creation/modification dates for a file or directory. Returns an empty table if the path does not exist. ```Lua LrFileUtils.fileAttributes( path ) ``` -------------------------------- ### LrApplication.metadataPresets() Source: https://lrc.mcor.dev/modules/LrApplication.html Reports available metadata presets. ```APIDOC ## LrApplication.metadataPresets() ### Description Reports available metadata presets. ### Method N/A (Function Call) ### Response #### Success Response - **presets**: (array) - An array of metadata preset objects. ``` -------------------------------- ### catalog:findPhotosWithProperty Source: https://lrc.mcor.dev/modules/LrCatalog.html Searches for photos that have a specific plug-in property. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## catalog:findPhotosWithProperty(pluginId, fieldName, optFieldVersion) ### Description Searches for photos with a specific plug-in property. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 2.0 of the Lightroom SDK. ### Parameters 1. **pluginId** (string) - The plug-in identifier. 2. **fieldName** (string) - The field identifier. 3. **optFieldVersion** (optional, number) - The version for the field. Note: If you are trying to reference an old version of a field that was not assigned a version number, you can use the number 0. ### Return value (array of `LrPhoto`) The photos that match the criteria. ``` -------------------------------- ### pubCollection:isSmartCollection Source: https://lrc.mcor.dev/modules/LrPublishedCollection.html Reports whether this collection is a smart collection. This function must be called from within an asynchronous task started using LrTasks. ```APIDOC ## pubCollection:isSmartCollection ### Description Reports whether this collection is a smart collection. ### Method (Implicitly called within an LrTasks context) ### Return Value (Boolean) True if this is a smart collection. ``` -------------------------------- ### LrDevelopController.startTracking Source: https://lrc.mcor.dev/modules/LrDevelopController.html Temporarily enables tracking state in the Develop module. This optimizes for faster, lower-quality redraws and prevents history states. ```APIDOC ## LrDevelopController.startTracking ### Description Temporarily puts the Develop module into its tracking state, causing faster, lower-quailty redraw and preventing history states from being generated. ### Parameters - **param** (any) - Required - The parameter to track. ``` -------------------------------- ### LrApplicationView.showView( viewName ) Source: https://lrc.mcor.dev/modules/LrApplicationView.html Switches the app's view mode. ```APIDOC ## LrApplicationView.showView( viewName ) ### Description Switches the app's view mode. ### Parameters #### Path Parameters - **viewName** (string) - Required - The name of the view to switch to. ### Method APIDOC ### Endpoint LrApplicationView.showView( viewName ) ``` -------------------------------- ### pubCollection:getPublishedPhotos Source: https://lrc.mcor.dev/modules/LrPublishedCollection.html Retrieves the publication data for photos in this collection. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## pubCollection:getPublishedPhotos ### Description Retrieves the publication data for photos in this collection. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ``` -------------------------------- ### pubCollection:getCollectionInfoSummary Source: https://lrc.mcor.dev/modules/LrPublishedCollection.html Retrieves an information summary about this published collection. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## pubCollection:getCollectionInfoSummary ### Description Retrieves an information summary about this published collection. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ### Return value table with the following information: * **name** : Name of the published collection * **localIdentifier** : Internal ID number of the collection (the local identifier). * **remoteId** : The ID of the collection on the remote service. * **remoteUrl** : URL of the collection (if applicable) as published. * **isDefaultCollection** : (Boolean) True if this is the default collection. * **parents** : (array of tables) Information about any published collection sets that contain this collection. An array of tables, each containing `name`, `localCollectionId`, `remoteCollectionId`, and `publishedUrl`. * **collectionSettings** : (table) Any collection-specific settings that have been stored by the plug-in. * **publishSettings** : (table) Publish settings for this plug-in. ``` -------------------------------- ### Build Smart Previews for Photos Source: https://lrc.mcor.dev/modules/LrCatalog.html Builds smart previews for a given set of photos. This function must be called from within an asynchronous task and creates a progress bar. It may return early on failure or user cancellation. ```lua catalog:buildSmartPreviews( photos ) ``` -------------------------------- ### pubCollectionSet:getService Source: https://lrc.mcor.dev/modules/LrPublishedCollectionSet.html Retrieves the publish service that this set belongs to. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## pubCollectionSet:getService() ### Description Retrieves the publish service that this set belongs to. ### Method `pubCollectionSet:getService()` ### Notes - This function must be called from within an asynchronous task started using `LrTasks`. - First supported in version 3.0 of the Lightroom SDK. ### Return value (LrPublishService) The publish-service object. ``` -------------------------------- ### Accessing Plugin Preferences Source: https://lrc.mcor.dev/modules/LrPrefs.html Demonstrates how to import the LrPrefs module and access a plugin's preference table to set a user name. Each plugin has its own namespace for preferences. ```lua local prefs = import 'LrPrefs'.prefsForPlugin() prefs.userName = 'John Smith' ``` -------------------------------- ### pubCollectionSet:getParent Source: https://lrc.mcor.dev/modules/LrPublishedCollectionSet.html Retrieves the parent set, if any, of this published-collection set. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## pubCollectionSet:getParent() ### Description Retrieves the parent set, if any of this published-collection set. ### Method `pubCollectionSet:getParent()` ### Notes - This function must be called from within an asynchronous task started using `LrTasks`. - First supported in version 3.0 of the Lightroom SDK. ### Return value (`LrPublishedCollectionSet`) The parent set, or nil. ``` -------------------------------- ### photo:applyDevelopSettings Source: https://lrc.mcor.dev/modules/LrPhoto.html Applies develop settings to an image. Requires the photo to exist and be an image, not a video. ```APIDOC ## photo:applyDevelopSettings ### Description apply develop settings to an image. First supported in version 6.0 of the Lightroom SDK. For this call to be successful, caller must ensure that the photo exists and it is an image not a video. ### Parameters 1. **settings** (table) - table of settings to be applied. 2. **optHistoryName** (optional, string) - name of the history step. 3. **optFlattenAutoNow** (optional, boolean) - True to resolve Auto settings synchronously within the context of this API call. ``` -------------------------------- ### LrFunctionContext.callWithEmptyEnvironment Source: https://lrc.mcor.dev/modules/LrFunctionContext.html Runs the main function in a known-safe function environment, equivalent to setfenv(func, {}). Imported namespaces and classes do not carry through. ```APIDOC ## LrFunctionContext.callWithEmptyEnvironment ### Description Runs the main function in a known-safe function environment. Equivalent to `setfenv( func, {} ); return func( ... )`. ### Method N/A (SDK function) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Parameters 1. **func** (function) - The main function to call, with an empty environment. 2. **...** (any) - Further arguments are passed through to the function. ### Return value (any) - The call results; that is, whatever is returned from the main function. ``` -------------------------------- ### publishService:getName Source: https://lrc.mcor.dev/modules/LrPublishService.html Retrieves the current name of the publish service. This function must be called from within an asynchronous task started using LrTasks. ```APIDOC ## publishService:getName() ### Description Retrieves the current name of the publish service. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ### Return value (string) The name. ``` -------------------------------- ### collectionSet:getParent Source: https://lrc.mcor.dev/modules/LrCollectionSet.html Retrieves the parent set, if any, of this collection set. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## collectionSet:getParent() ### Description Retrieves the parent set, if any of this collection set. ### Method (Implicitly a method call on an LrCollectionSet object) ### Parameters None ### Return value (`LrCollectionSet`) The parent set, or nil. ### Notes This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ``` -------------------------------- ### builderInstance:beginBlock Source: https://lrc.mcor.dev/modules/LrXml.html Adds an XML opening tag to the document being built. This tag must be closed later with a corresponding `endBlock()` call. ```APIDOC ## builderInstance:beginBlock ### Description Adds an XML opening tag to this XML document. This must be closed later by a call to `endBlock()`. ### Parameters #### Path Parameters - **name** (string) - Required - The name of the tag. - **attributes** (table, optional) - Optional - A set of attribute names and values. The keys and values in this table are converted to strings using `tostring()`. ### Return value None. ``` -------------------------------- ### collectionSet:getChildCollections Source: https://lrc.mcor.dev/modules/LrCollectionSet.html Retrieves the collections that are immediate children of this set. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## collectionSet:getChildCollections() ### Description Retrieves the collections that are immediate children of this set. Does not go into nested sets. ### Method (Implicitly a method call on an LrCollectionSet object) ### Parameters None ### Return value (array of `LrCollection`) The collection objects. ### Notes This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ``` -------------------------------- ### Create an Export Session Source: https://lrc.mcor.dev/modules/LrExportSession.html Creates an export session object with specified photos and export settings. This is the initial step for any export operation. ```Lua local exportSession = LrExportSession { photosToExport = { photo1, photo2, photo3 }, exportSettings = myExportSettings } ``` -------------------------------- ### pubCollectionSet:getCollectionSetInfoSummary Source: https://lrc.mcor.dev/modules/LrPublishedCollectionSet.html Retrieves an information summary about this published collection set. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## pubCollectionSet:getCollectionSetInfoSummary() ### Description Retrieves an information summary about this published collection set. ### Method `pubCollectionSet:getCollectionSetInfoSummary()` ### Notes - This function must be called from within an asynchronous task started using `LrTasks`. - First supported in version 3.0 of the Lightroom SDK. ### Return value A table with the following information: * **name** : Name of the published collection set. * **localIdentifier** : Internal ID number of the collection set (the local identifier). * **remoteId** : The ID of the collection set on the remote service. * **remoteUrl** : URL of the collection set (if applicable) as published. * **isDefaultCollection** : (Boolean) True if this is the default collection. * **parents** : (array of tables) Information about any published collection sets that contain this collection. An array of tables, each containing `name`, `localCollectionId`, `remoteCollectionId`, and `publishedUrl`. * **collectionSettings** : (table) Any collection-specific settings that have been stored by the plug-in. * **publishSettings** : (table) Publish settings for this plug-in. ``` -------------------------------- ### ftpConnection:makeDirectory Source: https://lrc.mcor.dev/modules/LrFtp.html Creates a directory on the remote FTP server. ```APIDOC ## ftpConnection:makeDirectory ### Description Creates a directory on the remote server. ### Method ftpConnection:makeDirectory( directoryName ) ### Parameters - **directoryName** (string) - The name of the directory to create. ``` -------------------------------- ### Create Optimized Log Functions (logger:quick) Source: https://lrc.mcor.dev/modules/LrLogger.html Use `logger:quick` to create optimized versions of log functions for tight loops. These functions avoid method lookup overhead and become no-ops when logging is disabled. They are suitable for simple log messages without formatting. ```lua local warn, info = logger:quick( 'warn', 'info' ) warn( 'something bad happened' ) ``` -------------------------------- ### pubCollectionSet:getChildCollections Source: https://lrc.mcor.dev/modules/LrPublishedCollectionSet.html Retrieves the published collections that are immediate children of this set. This function must be called from within an asynchronous task started using `LrTasks`. ```APIDOC ## pubCollectionSet:getChildCollections() ### Description Retrieves the published collections that are immediate children of this set. Does not go into nested sets. ### Method `pubCollectionSet:getChildCollections()` ### Notes - This function must be called from within an asynchronous task started using `LrTasks`. - First supported in version 3.0 of the Lightroom SDK. ### Return value (array of `LrPublishedCollection`) The published-collection objects. ``` -------------------------------- ### catalog:buildSmartPreviews Source: https://lrc.mcor.dev/modules/LrCatalog.html Generates smart previews for a given set of photos. ```APIDOC ## catalog:buildSmartPreviews ### Description Builds a smart preview for a set of photos. ### Parameters - **photos** (array) - Required - An array of photo objects for which to build smart previews. ``` -------------------------------- ### publishService:getPluginId Source: https://lrc.mcor.dev/modules/LrPublishService.html Retrieves the unique identifier for the plug-in to which this service belongs. This function must be called from within an asynchronous task started using LrTasks. ```APIDOC ## publishService:getPluginId() ### Description Retrieves the unique identifier for the plug-in to which this service belongs. Note that if the plug-in's LrExportServiceProvider definition is a table of tables, the plug-in id returned by this function will have a '.' followed by a number appended to it. The number corresponds to the export service provider to which this service belongs. This function must be called from within an asynchronous task started using `LrTasks`. First supported in version 3.0 of the Lightroom SDK. ### Return value (string) The plug-in ID. ```