SDK how to make an image to be shown in the Develop module
Being somewhere in the Library module, I want a certain image to be show / active in the Develop module.
The code below works as long as the image to be shown is in the grid.
However, when the image is not in the active grid, then the Develop module reports "No photo selected".
Even though if I go back to the grid and select "All photographs" in the left panel, the image is the selected image with the white border.
The issue is that upon the start of this plug-in I want to show a specific image in the Develop module, however I have no glue which folder or collection is active at that moment.
local function showInDevelopModule(photo)
catalog:setSelectedPhotos(photo, {})
local moduleName = LrApplicationView.getCurrentModuleName()
if (moduleName ~= "develop") then
LrApplicationView.switchToModule("develop")
end
end
LrFunctionContext.postAsyncTaskWithContext("test", function(context)
local message = nil
LrDialogs.attachErrorDialogToFunctionContext(context)
local photo = catalog:findPhotoByUuid("0AFA8451-6DDD-4CF6-B537-DB1E9FB53A88")
showInDevelopModule(photo)
end)
