Copy link to clipboard
Copied
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?
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
...Copy link to clipboard
Copied
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().
Copy link to clipboard
Copied
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
```
Find more inspiration, events, and resources on the new Adobe Community
Explore Now