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:

  1. comStatus - true iff saved in common location.
  2. catStatus - true iff saved with catalog.
  3. 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:

  1. exe file path or nil if none
  2. 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:

  1. dir (or nil)
  2. 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:

  1. dir (or nil)
  2. 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:

  1. restart function appropriate for OS, or nil.
  2. 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. 

Valid XHTML 1.0!