Copy/cut/paste problems in lua-script
Copy, cut and paste actions do not always seem to work reliably when used in a lua-script.
The following workarounds have lead to significant improvement in my case:
Copy: There is a alternative action to 40057: 40210
Cut: Again, there is an alternative to 40059: 40337
Paste: This is a little trickier - a loop retrying the pasting a number of times increased the stability of the script:
N_PasteCtr = 1
while reaper.GetTrack(0, TrID) ~= nil and N_PasteCtr < 10 do
reaper.Main_OnCommand(40058, 0)
N_PasteCtr = N_PasteCtr + 1
end
|