Does your module have executable code in the body of it? If so, consider putting it in a function, then call the function when you are ready, so nothing gets executed when the module is "require'd".
action = function( button )
-- start task
action = "call a function that starts a task"
In the first case, you are assigning a function value to action which will get called when the user clicks the button.
In the second case, you are calling a function and assigning the return value to action.
Thanks for helping me with this. Since this is so new to me, I'm all over the place and I'm having trouble even understanding what my problems are :-)
Anyway, here's where I'm at:
I have a button in sectionsForTopOfDialog. I have changed the action to be action = function() .... end
When I press the button the function is called. The problem is when I call the LrHttp.post function. That's when the yield error is being thrown.
The problem is when I call the LrHttp.post function. That's when the yield error is being thrown.
The error message "Yielding is not allowed within a C or metamethod call" arises when you call a function or method that needs to be invoked from a task created by LrTasks or LrFunctionContext.postAsyncTaskWithContext.
In this case, the LrHttp functions have to be called from a task. The SDK documentation is pretty good (but not perfect) about calling out which functions and methods have to be called from a task.
Thanks! Of course, that was my problem.