those are two scripts... you don't have to write anything
either they are in your actions list or they are added is you install SWS extensions...
or if not, save each of these as a .lua file and put them into your scripts folder:
this is the copy:
Xen Copy Selected Track Names.lua
Quote:
local numselected = reaper.CountSelectedTracks(0)
if numselected>0 then
reaper.SetExtState("copytracknames","numtracks",nu mselected,true)
for i=0,numselected-1 do
local track = reaper.GetSelectedTrack(0,i)
local rv, trackname = reaper.GetTrackName(track,"")
if rv~=0 then
--reaper.ShowConsoleMsg(trackname.."\n")
reaper.SetExtState("copytracknames","name"..i,trac kname,true)
end
end
end
|
this is the paste:
Xen Paste to Selected Track Names.lua
Quote:
local numstoredtracks = tonumber(reaper.GetExtState("copytracknames","numt racks"))
if numstoredtracks>0 then
for i=0,numstoredtracks-1 do
local trackname = reaper.GetExtState("copytracknames","name"..i)
if i<reaper.CountSelectedTracks(0) then
local dest_track = reaper.GetSelectedTrack(0,i)
reaper.GetSetMediaTrackInfo_String(dest_track, "P_NAME", trackname, true)
end
end
reaper.UpdateArrange()
end
|
*****************
they are just text files but the file name extension must be .lua instead of .txt
If they don't just show up in the actions list, then use the reascript add and go find them and add them...
It really can't be much easier... you select a given number of tracks that are in the order you want... then run the copy script action
then select a corresponding set of other tracks, again in the order you wish [should be same as the order you copied from]... and run the paste action...
very useful stuff