I have seen this statement in a few lua scripts and had to include it in some of my own scripts calling Main_OnCommand
for key in pairs(reaper) do _G[key]=reaper[key] end
Could someone who knows a lot more about this explain why this is necessary? (copying the functions to the Lua global namespace?)
Printing the same keys to console is an expensive operation, as more functions are added any scripts with this command would slow down over time also.
Is there any way to do this more efficiently e.g. copying specific/selected functions to the Lua global?
Thanks a lot in advance for such a basic question.
|