Reaper-Scripts/4PointCutting/4Pcut_set_src-tracks.lua

26 lines
942 B
Lua

-- Reaper Scripts for 4 point editing. This script sets the source tracks and stores it to the rpp.
-- Author: Ludwig Frühschütz
-- Source: https://www.eleton-audio.de
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
-- License: GPL v3.0
-- Requires: Reaper 5 or 6
-- Requires: This script goes with several other scripts that work closely together.
-- Send a message to the console
function msg(m)
reaper.ShowConsoleMsg(tostring(m) .. "\n")
end
-- START HERE vvvvvvv
if reaper.CountSelectedTracks(0) <= 0 then
reaper.ClearConsole()
msg('No track selected!')
return
end
-- get list of selected tracks and make string of GUIDs
local sel_tracks = ''
for i = 0, reaper.CountSelectedTracks(0)-1 do
sel_tracks = sel_tracks .. reaper.GetTrackGUID(reaper.GetSelectedTrack(0, i))
end
-- store selected tracks to rpp
reaper.SetProjExtState(0, '4PointCut', 'src_tracks', sel_tracks)