Hi -- I need some help again!
I'm writing an export plugin for my own application.
On Windows, everything works as expected -- I can start the export and then go back to doing other tasks in Lightroom while my application does its own thing.
But on Macintosh, Lightroom hangs with the rotating "busy" icon until my application quits.
I am baffled by this behavior because I think I've wrapped everything I'm doing in calls to LrTasks.startAsyncTask.
Apparently I'm missing something about how asynchronous tasks work in Lightroom, or at least in Lightroom on Macintosh.
Do you have any suggestions about how I can get the Mac version to keep Lightroom responsive while my exported-to application does its thing?
Thanks!
--Rik
For further information...
Mac OS X 10.9, Lightroom 4.2
Here is the current structure of my ExportToMA.lua file
local myLogger = LrLogger("myLogger")
myLogger:enable("logfile")
ExportToMA = {}
ExportToMA.outputToLog = function(param)
myLogger:trace(param)
end
LrTasks.startAsyncTask( function()
myLogger:trace("Entering outer LrTasks.startAsyncTask function")
...
LrTasks.startAsyncTask( function()
myLogger:trace("Entering inner LrTasks.startAsyncTask function")
local activeCatalog = LrApplication.activeCatalog()
local frameSet = activeCatalog.targetPhotos
local exportSession = LrExportSession( {
exportSettings = {
LR_exportServiceProvider = "net.mydomain.MAloader",
LR_exportServiceProviderTitle = "My Application",
LR_format = "TIFF",
LR_tiff_compressionMethod = "compressionMethod_None",
LR_export_bitDepth = 16,
LR_export_colorSpace = "sRGB",
LR_minimizeEmbeddedMetadata = false
},
photosToExport = frameSet,
} )
myLogger:trace("Before doExportOnCurrentTask()")
exportSession:doExportOnCurrentTask()
myLogger:trace("After doExportOnCurrentTask()")
myLogger:trace("Exiting inner LrTasks.startAsyncTask function")
end )
myLogger:trace("Exiting outer LrTasks.startAsyncTask function")
end )
When run on Windows, the log file contains a sequence of messages like this:
12/30/2013 10:36:48 TRACE Entering outer LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE Exiting outer LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE Entering inner LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE Before doExportOnCurrentTask()
12/30/2013 10:36:49 TRACE After doExportOnCurrentTask()
12/30/2013 10:36:49 TRACE Exiting inner LrTasks.startAsyncTask function
<meanwhile my application continues to run while Lightroom stays responsive>
But when run on Macintosh, this is what happens:
2013-12-30 19:01:50 +0000, TRACE Entering outer LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE Exiting outer LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE Entering inner LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE Before doExportOnCurrentTask()
<indefinitely long pause while my application runs>
2013-12-30 19:02:44 +0000, TRACE After doExportOnCurrentTask()
2013-12-30 19:02:44 +0000, TRACE Exiting inner LrTasks.startAsyncTask function
Ideas?