withWriteAccessDo problems with Debug plugin
Hi dear all,
I am just starting writing Lightroom plugins (well, I had a first success 2 years ago but now I am starting again with more complicated stuff), and of course I do love the Debug plugin (Thanks again, John!) - but I am still struggling with some concepts and the limitations that might be imposed by it.
Concretely, I run into the error "Attempt to access property "myPropertyName" that's not declared in Info.lua", when running my script using the Debug dialog. It works when I just run it from the Plugin Extras menu as a menu action.
The code:
| LrTasks.startAsyncTask(Debug.showErrors(function(context) | |
| local catalog = LrApplication.activeCatalog() | |
| local selected = catalog:getTargetPhotos() |
...
| for key, s in pairs(values) do | |
| catalog:withWriteAccessDo("writing data", Debug.showErrors(function(context) | |
| photo:setPropertyForPlugin(_PLUGIN, "myPropertyName", s) | |
| end)) | |
| end |
I found something in the Internet this being an indication of a race condition, so maybe this has something to do with one script wrapping / running the other? Or is there a way to get this running with the Debug script, and I am just not understanding the notion of background tasks/threads yet :-)?
Thanks for your help!
Christof
(I am on LR 5)
