Skip to main content
johnrellis
Legend
September 1, 2022
Question

SDK: LrDevelopController.resetAllAdjustments() cancels modal dialog

  • September 1, 2022
  • 0 replies
  • 85 views

Calling LrDevelopController.resetAllAdjustments() from within a modal dialog causes the dialog to exit with the return result of "cancel" (as if the user clicked the Cancel button).  This occurs with my LR 11.5 on Mac OS 12.4 but not on Windows 10.

 

To reproduce, put the following script in the Scripts folder, restart LR, and invoke the script from the Scripts menu.  Click the Reset button twice.

 

local LrApplicationView = import "LrApplicationView"
local LrDevelopController = import "LrDevelopController"
local LrDialogs = import "LrDialogs"
local LrTasks = import "LrTasks"
local LrView = import "LrView"

local f = LrView.osFactory()

LrTasks.startAsyncTask (function ()
    LrApplicationView.switchToModule ("develop")
    local result = LrDialogs.presentModalDialog {
        title = "Reset Develop Adjustments", 
        contents = f:push_button {title = "Reset",
            action = function ()
                LrDevelopController.resetAllDevelopAdjustments () 
                end}}
    LrDialogs.message ("LrDialog.presetModalDialog result", result)
    end)
This topic has been closed for replies.