Old 09-09-2018, 01:52 AM   #1
Dupal
Human being with feelings
 
Dupal's Avatar
 
Join Date: Oct 2014
Location: Schweiz
Posts: 16
Default 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
Dupal is offline   Reply With Quote
Old 09-09-2018, 07:46 AM   #2
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

The first set of actions are context-dependent:

40057 - Edit: Copy items/tracks/envelope points (depending on focus) ignoring time selection

They'll copy tracks, or items, or envelope points, depending on what Reaper considers to be "in focus". So yeah, from a script they would be very unpredictable.

The second set are very specific:

40210 - Track: Copy tracks
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.