Reaper-Tools

Audiokinetic Reaper Tools Repository
Log | Files | Refs

commit d26af808a22cee5b1446f8ebc5b2f25a5c2d24ae
parent 5794166f9029059957a5a24f308b07b6afff6ce5
Author: James Stubbs <jstubbs@audiokinetic.com>
Date:   Wed, 31 Jan 2024 17:53:04 -0500

SP-3256: Alert user if no track is selected to do copy script and return to prevent error messages and unexpected behaviour.

Change-Id: Ic22a7506d75c8a949c2b3a0bc4d18d719926b46d

Diffstat:
MScripts/Strata_Copy collection elements within selection to next project tab.lua | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Scripts/Strata_Copy collection elements within selection to next project tab.lua b/Scripts/Strata_Copy collection elements within selection to next project tab.lua @@ -58,7 +58,13 @@ local currentProj = reaper.EnumProjects(-1) local time_sel_start, time_sel_end = reaper.GetSet_LoopTimeRange2(currentProj, false, false, 0, 0, false) if time_sel_start == time_sel_end then - assert(nil, "There is nothing to copy. Please make a time selection.") + reaper.ShowMessageBox("There is nothing to copy. Please make a time selection!", "Strata Copy Script Error", 0) + return +end + +-- No point continuing script if there are no tracks selected! +if reaper.CountSelectedTracks(currentProj) == 0 then + reaper.ShowMessageBox("No selected tracks to copy!", "Strata Copy Script Error", 0) return end