Skip to content

Commit 4f4716f

Browse files
authored
Release Insert =START and =END markers to time selection for subprojects v1.1 (#727)
Script now first removes existing =START and =END markers to avoid confusion
1 parent 8487e82 commit 4f4716f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Rendering/uorcun_Insert start and end markers to time selection for subprojects.lua

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
-- @description Insert =START and =END markers to time selection for subprojects
22
-- @author Ugurcan Orcun
3-
-- @version 1.0
4-
-- @about Automatically inserts =START and =END to each side of time selection. Rendering Subprojects obey these two markers.
3+
-- @version 1.1
4+
-- @changelog Script now first removes existing =START and =END markers to avoid confusion
5+
-- @about Automatically inserts =START and =END markers to each side of time selection. Rendering Subprojects obey these two markers.
56

67
reaper.Undo_BeginBlock()
78
marker_start, marker_end = reaper.GetSet_LoopTimeRange(false, true, 0, 0, 0)
89

10+
--Remove existing markers
11+
for i = reaper.CountProjectMarkers(0), 0, -1 do
12+
a, b, c, d, name, index = reaper.EnumProjectMarkers2(0,i)
13+
if (name == "=START") or (name == "=END") then
14+
reaper.DeleteProjectMarkerByIndex(0, i)
15+
end
16+
end
17+
18+
--Add new markers
919
if marker_start < marker_end then
1020
reaper.AddProjectMarker(0, false, marker_start, 0, "=START", -1)
1121
reaper.AddProjectMarker(0, false, marker_end, 0, "=END", -1)

0 commit comments

Comments
 (0)