Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

exportSettings

Community Beginner ,
Aug 27, 2023 Aug 27, 2023

I want to create a script to export photos. I already created several small scripts for myself, I see there is `LrExportSession` to do this, but I cannot find anywhere examples of the `exportSettings` parameter it takes. Is there anywhere I can find an overview of all the settings in the export dialog and their corresponding names in this argument? Or even more conveniently, is there any way I can use my named export presets to fill this in?

TOPICS
SDK
310
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 27, 2023 Aug 27, 2023

I didn't find any simple examples in the SDK folders. However, if you search this forum for "lrexportsession" you'll find many code snippets that give examples of the parameters passed to LrExportSession().

 

The actual parameters themselves aren't documented anywhere. But it's usually pretty easy to figure out what you need -- in the LR application, create an export preset, and then examine the preset's .lrtemplate file in a text editor.  To find where the presets are stored in the file system, i

...
Translate
LEGEND ,
Aug 27, 2023 Aug 27, 2023

I didn't find any simple examples in the SDK folders. However, if you search this forum for "lrexportsession" you'll find many code snippets that give examples of the parameters passed to LrExportSession().

 

The actual parameters themselves aren't documented anywhere. But it's usually pretty easy to figure out what you need -- in the LR application, create an export preset, and then examine the preset's .lrtemplate file in a text editor.  To find where the presets are stored in the file system, in the Export window right-click a preset and do Show In Finder / Explorer.

 

While the SDK doesn't provide direct support for accessing export presets, they're straightforward to access.  Each .lrtemplate file can be read using the Lua built-in function dofile().

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2023 Aug 31, 2023
LATEST

Thanks, that works nicely! 

 

For anyone finding this, here's what I use:


```

function loadExportPreset(presetName)
local full_preset_path = presetPath .. presetName .. ".lrtemplate"
dofile(full_preset_path)
local preset = s.value

-- need to rename all the keys, prefixing them with LR_
local renamed_preset = {}
for k, v in pairs(preset) do
renamed_preset["LR_" .. k] = v
end
return renamed_preset
end

```

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines