Namespace LrApplication

This namespace provides access to the active catalog and application-wide information, such as version information.

Access the functions directly from the imported namespace.

Summary

Retrieves the catalog that is currently open in Lightroom.
LrApplication.addDevelopPresetForPlugin( plugin, presetName, presetValue )
Adds a preset hidden within a plug-in.
Retrieves a unique identifier that is keyed to Mac App Store receipt.
Requests a catalog backup to be performed next time Lightroom closes.
Retrieves a develop preset from its unique identifier.
Retrieves all defined develop preset folders.
Reports available file-naming presets.
Retrieves a specific develop preset, or all develop presets associated with this plug-in.
Retrieves a unique identifier that is keyed to the MAC address of the system running Lightroom.
Reports available metadata presets.
Returns a string identifying the manner in which the Lightroom instance was obtained.
Retrieves a unique identifier that is keyed to the Lightroom serial number.
Retrieves the current version of the application as a user-displayable string (for instance, "2.0").
Retrieves the current version of the application as a table that can be parsed.
Reports available view-filter presets.

Functions

LrApplication.activeCatalog()
Retrieves the catalog that is currently open in Lightroom.

First supported in version 1.3 of the Lightroom SDK.

Return value

(LrCatalog) The catalog object.

See also

LrCatalog
LrApplication.addDevelopPresetForPlugin( plugin, presetName, presetValue )
Adds a preset hidden within a plug-in. These presets are stored in a special folder called "Plugin Develop Presets." They do not appear in the presets panel in the Develop module, and cannot be retrieved by ID.

This type of preset can be retrieved using LrApplication:getDevelopPresetsForPlugin(). To apply the preset, use LrPhoto:applyDevelopPresetFromPlugin.

First supported in version 3.0 of the Lightroom SDK.

Parameters

1. plugin
(_PLUGIN) Your plug-in object.
2. presetName
(string) The preset's name.
3. presetValue
(table) The setting values for the preset. For allowed values, see LrDevelopPreset:getSetting.

Return value

(LrDevelopPreset) The preset object.
LrApplication.appStoreReceiptHash()
Retrieves a unique identifier that is keyed to Mac App Store receipt. This is intended to aid in plug-in registrations for app store builds of Lightroom, where there is no serial number available.

First supported in version 4.1 of the Lightroom SDK.

Return value

(string) The unique ID, or nil if the running version of Lightroom is not from the Mac App Store.
LrApplication.backupAtNextShutdown( pluginId )
Requests a catalog backup to be performed next time Lightroom closes. This does not alter the backup periodicity already in place, other than by affecting the recorded time for last backup, if the user does not choose to skip the backup via the dialog at shutdown time.

First supported in version 4.0 of the Lightroom SDK.

Parameters

1. pluginId
(string) The plugin identifier (_PLUGIN.id)
LrApplication.developPresetByUuid( uuid )
Retrieves a develop preset from its unique identifier. This does not retrieve presets added using LrApplication:addDevelopPresetForPlugin.

First supported in version 3.0 of the Lightroom SDK.

Parameters

1. uuid
(string) The unique identifier, as returned by LrDevelopPreset:getUuid.

Return value

(LrDevelopPreset) The preset object.
LrApplication.developPresetFolders()
Retrieves all defined develop preset folders.

First supported in version 3.0 of the Lightroom SDK.

Return value

(array of LrDevelopPresetFolder) The preset folder objects.
LrApplication.filenamePresets()
Reports available file-naming presets.

First supported in version 3.0 of the Lightroom SDK.

Return value

(table) A table describing each of the available file-naming presets, or an empty table if no presets exist.
  • key: The preset name.
  • value: The UUID or path to the preset's definition.
LrApplication.getDevelopPresetsForPlugin( plugin, uuid )
Retrieves a specific develop preset, or all develop presets associated with this plug-in.

First supported in version 3.0 of the Lightroom SDK.

Parameters

1. plugin
(_PLUGIN) Your plug-in object.
2. uuid
(string) Optional, the unique identifier of a preset. See LrDevelopPreset:getUuid.

Return value

(LrDevelopPreset or array of LrDevelopPreset) The specified preset object, or an array of all associated presets if no unique ID is supplied.
LrApplication.macAddressHash()
Retrieves a unique identifier that is keyed to the MAC address of the system running Lightroom. This is intended to aid in plug-in registrations for app store builds of Lightroom, where there is no serial number available.

First supported in version 4.1 of the Lightroom SDK.

Return value

(string) The unique ID.
LrApplication.metadataPresets()
Reports available metadata presets. The returned table contains the name of each metadata property along with its string ID. For example, an entry might be: "_MSD Basic Details" = "BEDF33BA-47FE-4076-9088-2FC3CBACAF10",.

First supported in version 3.0 of the Lightroom SDK.

Return value

(table) A table describing each of the available metadata presets, or an empty table if no presets exist.
  • key: The preset name.
  • value: The UUID or path to the preset's definition.
LrApplication.purchaseSource()
Returns a string identifying the manner in which the Lightroom instance was obtained. This is intended to aid in plug-in registrations for app store builds of Lightroom, where there is no serial number available.

First supported in version 4.1 of the Lightroom SDK.

Return value

(string) 'retail', or 'MAS' if the running version of Lightroom was purchased from the Mac App Store. As of Lightroom 5.6, if the running version of Lightroom was installed from the Adobe Creative Cloud, the string 'CC' will be returned.
LrApplication.serialNumberHash()
Retrieves a unique identifier that is keyed to the Lightroom serial number. This can be used to implement plug-in registrations.

First supported in version 3.0 of the Lightroom SDK.

Return value

(string) The unique ID, or "trial" if no serial number is installed (as in 30-day trial mode). As of Lightroom 4.1, if the running version of Lightroom is from the Mac App Store, an empty string will be returned. As of Lightroom 5.6, if the running version of Lightroom was installed from the Adobe Creative Cloud, an empty string will be returned.
LrApplication.versionString()
Retrieves the current version of the application as a user-displayable string (for instance, "2.0").

First supported in version 2.0 of the Lightroom SDK.

Return value

(string) Lightroom version
LrApplication.versionTable()
Retrieves the current version of the application as a table that can be parsed. For example, a version such as 8.2.1 contains three components, the major version (8), the minor version (2), and the revision number (1) of a specific release. There is also a build version string, and a public beta number or indicator. The build_version is available from 8.3.0 as a string and represents the unique build number.

Note: In releases prior to v8.3.0, the build number is usually a 6/7-digit number. In v8.3.0, the build number (deprecated) represents the date of the build, in the form YYYYMMDDHHmm.

First supported in version 2.0 of the Lightroom SDK.

Return value

(table) Lightroom version. Contains the following members:
  • major: (number) Major version number
  • minor: (number) Minor version number
  • revision: (number) Revision number
  • build (deprecated): (number) Build number in the form YYYYMMDDHHmm - the date of the build
  • build_version: (string) Build version as a string
  • publicBeta (deprecated): (number or Boolean) Public beta number, or false for final or near-final release.
LrApplication.viewFilterPresets()
Reports available view-filter presets.

First supported in version 3.0 of the Lightroom SDK.

Return values

  1. (table) A table describing each of the available view-filter presets, or an empty table if no presets exist.
    • key: The preset name.
    • value: The UUID or path to the preset's definition.
  2. (string) If a named filter is currently invoked, the name of that filter.