Skip to main content
Participant
February 5, 2018
Answered

Could you help me to find the right function ?

  • February 5, 2018
  • 1 reply
  • 509 views

Hi everybody,

I'm looking for the function which listing all exporting process (see my pict). My LR version is in french and it is a little bit difficult - for me - to find the name of the correct function into the SDK (argh, 'cause french translation ).

Is it "getPublishServices" ?

Thank you a lot

This topic has been closed for replies.
Correct answer johnrellis

Unfortunately, I don't believe there is an API function that lists all the export presets.

However, the user presets are stored in the Export Presets folder, which you can find by doing Preferences > Presets > Show Lightroom Presets Folder.  These files are easily read using the Lua function loadfile().  You can extract the export settings from the loaded objects and pass them to LrExportSession().

1 reply

johnrellis
johnrellisCorrect answer
Legend
February 5, 2018

Unfortunately, I don't believe there is an API function that lists all the export presets.

However, the user presets are stored in the Export Presets folder, which you can find by doing Preferences > Presets > Show Lightroom Presets Folder.  These files are easily read using the Lua function loadfile().  You can extract the export settings from the loaded objects and pass them to LrExportSession().

Dominik_FAuthor
Participant
February 5, 2018

Great. Thank you John. Good news

Correct. I found a complete list of presets in the Export Presets folder. Yeah.

Another question. Is it possible to launch à User Export Preset directly from the API ?

johnrellis
Legend
February 5, 2018

Is it possible to launch à User Export Preset directly from the API ?

Read the contents of the .lrtemplate file using the Lua library loadfile() or dofile(). That sets the global variable "s" to the contents you see in the file. Make a new table that's a copy of s.value, but with every key prefixed with "LR_", e.g. changing:

exportServiceProviderTitle = "Hard Drive",

export_bitDepth = 16,

to:

LR_exportServiceProviderTitle = "Hard Drive",

LR_export_bitDepth = 16,

Then pass that table to LrExportSession(), and use the methods of that class to run the export.