File Lightroom.lua
Functions
Lightroom:assurePreset (presetSubdir, presetName, textValue, suppressExtension, forceUpdate) | Save preset, in both dirs if possible - w/catalog and common/shared. |
Lightroom:computeLrAppPath () | Determine Lr app/exe file path based on develop preset folders, or whatever means possible. |
Lightroom:exit () | Exit Lightroom |
Lightroom:getCameraProfiles (model) | Get camera calibration profile items corresponding to specified model. |
Lightroom:getDevelopPresetItems (params) | Get (popup compatible) array of develop preset items - value is UUID. |
Lightroom:getDevelopPresetNames () | Get (combo-box compatible) array of develop preset names. |
Lightroom:getFilenamePresetDir () | Get filename preset dir. |
Lightroom:getFilenamePresetDir2 () | Get filename preset dir - 2nd version (recommended). |
Lightroom:getMetadataPresetItems (substr) | Get (popup compatible) array of metadata preset items - value is UUID. |
Lightroom:getPrefsDir () | Get filename preset dir - 2nd version (recommended). |
Lightroom:getPresetDir (subdir, create) | Generic function for getting Lightroom settings dir - either root or subdir. |
Lightroom:new (t) | Constructor for new instance. |
Lightroom:newClass (t) | Constructor for extending class. |
Lightroom:prepareForRestart (catPath) | Evaluate conditions necessary for successfully restarting Lightroom. |
Lightroom:restart (catPath, noPrompt) | Restarts lightroom with current or specified catalog *** @deprecated, since does not save prefs - use other method, unless you want to subvert prefs. |
Functions
- Lightroom:assurePreset (presetSubdir, presetName, textValue, suppressExtension, forceUpdate)
-
Save preset, in both dirs if possible - w/catalog and common/shared.
Parameters:
-
presetSubdir
: (string, required) e.g. 'Export Actions' -
presetName
: (string, required) base name, will have .lrtemplate appended. -
textValue
: (string, required) preset value in text form. -
suppressExtension
: (boolean, default=false) set true to not append .lrtemplate. -
forceUpdate
: (boolean, default=false) set true to to force update (copy even if already existing).
Return values:
- comStatus - true iff saved in common location.
- catStatus - true iff saved with catalog.
- message - qualifying message, will be non-empty string unless both statuses are true.
-
- Lightroom:computeLrAppPath ()
-
Determine Lr app/exe file path based on develop preset folders, or whatever means possible.
Return values:
- exe file path or nil if none
- Lr program folder path or error message.
- Lightroom:exit ()
- Exit Lightroom
- Lightroom:getCameraProfiles (model)
-
Get camera calibration profile items corresponding to specified model.
Parameters:
-
model
:
-
- Lightroom:getDevelopPresetItems (params)
-
Get (popup compatible) array of develop preset items - value is UUID.
Parameters:
-
params
: optional table of parameters (all members are optional):
folderIncl
folderExcl
nameIncl
nameExcl
-
- Lightroom:getDevelopPresetNames ()
- Get (combo-box compatible) array of develop preset names. ###3 consider a develop-presets module.
- Lightroom:getFilenamePresetDir ()
- Get filename preset dir.
- Lightroom:getFilenamePresetDir2 ()
-
Get filename preset dir - 2nd version (recommended).
Return values:
- dir (or nil)
- reason for nil dir (or nil itself).
- Lightroom:getMetadataPresetItems (substr)
-
Get (popup compatible) array of metadata preset items - value is UUID.
Parameters:
-
substr
:
-
- Lightroom:getPrefsDir ()
-
Get filename preset dir - 2nd version (recommended).
Return values:
- dir (or nil)
- reason for nil dir (or nil itself).
- Lightroom:getPresetDir (subdir, create)
-
Generic function for getting Lightroom settings dir - either root or subdir. @usage: lightroo m : g etPresetDir() same as lightroom:computeActivePresetDir() @usage: lightroo m : g etPresetDir( 'Preferences' ) to get prefs dir.. @usage: lightroo m : g etPresetDir( 'Filename Templates' ) to get fn tmpl dir.. @usage: lightroo m : g etPresetDir( 'Export Presets' ) to get export preset dir..
Parameters:
-
subdir
: -
create
:
-
- Lightroom:new (t)
-
Constructor for new instance.
Parameters:
-
t
:
-
- Lightroom:newClass (t)
-
Constructor for extending class.
Parameters:
-
t
:
-
- Lightroom:prepareForRestart (catPath)
-
Evaluate conditions necessary for successfully restarting Lightroom. *** saves prefs?
Parameters:
-
catPath
:
Return values:
- restart function appropriate for OS, or nil.
- status message to explain no restart function.
-
- Lightroom:restart (catPath, noPrompt)
-
Restarts lightroom with current or specified catalog *** @deprecated, since does not save prefs - use other method, unless you want to subvert prefs.
Parameters:
-
catPath
: (string, default = current catalog) path to catalog to restart with. -
noPrompt
: (boolean, default = false) set true for no prompting, otherwise user will be prompted prior to restart, if prompt not permanently dismissed that is.
Usage:
*** Does NOT save preferences on the way out (@25/Nov/2013, there is no way I know to restart and save prefs).
depends on 'lrApp' pref or global-pref for exe-path in windows environment - if not there, user will be prompted for exe file.
-