I'm having problems with error dialogs inside of event handlers (excuse me if that's not the vernacular used for LUA/LR). The code below opens a dialog with a single button which causes an assert(false) condition. Inside the handler, there is no error message box displayed. Outside the handler, an error message is displayed. I've tried calling LrDialogs.attachErrorDialogToFunctionContext with no change and I also tried wrapping showCustomDialog and the anonymous action with John R. Ellis's showErrors and still do not get an error message. What am I missing? -- required imports local LrDialogs = import "LrDialogs" local LrTasks = import "LrTasks" local LrView = import "LrView" local LrFunctionContext = import "LrFunctionContext" local function showCustomDialog() LrFunctionContext.callWithContext( "showCustomDialog", function( context ) -- This assert will show a dialog -- assert(false,"false assertion") local viewFactory = LrView.osFactory() local content = viewFactory:push_button { title = "Push Me", action = function() -- this does not show a dialog assert(false,"false assertion") end } LrDialogs.presentFloatingDialog( _PLUGIN, { title = "My Dialog", contents = content, } ) end) end LrTasks.startAsyncTask(showCustomDialog)
... View more