Calling LrTasks.execute from within a plug in manager control
I'm working on a Lightroom post-processing-filter plug in which has most of the functionality inside an executable that resides inside the plug in folder.
The executable is responsible for doing the actual photo processing but is also responsible for obtaining and verifying that there is a valid license. This means that I need to let the user eneter an activation code, pass that to the executable which will talk to our server and get a license.
I would like to handle that activation part from the plug-in manager dialog so I've added a top section (see following code) with a text field and a button and I've added code to call the executable when the button is pressed, but the executalbe is never called.
Is what I'm trying to do impossible? Any workarounds?
Thanks in advance!
Eyal
function PluginManager.sectionsForTopOfDialog( f, p )
p.my_result = 0
return {
-- section for the top of the dialog
{
bind_to_object = p,
title = "MyPlug",
f:row {
spacing = f:control_spacing(),
f:static_text {
title = LrView.bind( "my_result")
},
f:push_button {
width = 150,
title = 'Run Exe',
enabled = true,
action = function()
command = '"' .. LrPathUtils.child(LrPathUtils.child( _PLUGIN.path, "mac" ), "MyTool" ) .. '" ' .. '-action check"'
quotedCommand = command
p.my_result = LrTasks.execute( quotedCommand )
end,
},
},
},
}
end