------------------ В начало -----------------------
local function SaveSelTracksGuid()
reaper.PreventUIRefresh(123456789)
reaper.SetOnlyTrackSelected(reaper.GetTrack(0,0))
reaper.SetTrackSelected(reaper.GetTrack(0,0), 0)
for i = 1,reaper.CountSelectedMediaItems( 0 ) do
reaper.SetTrackSelected(reaper.GetMediaItem_Track
(reaper.GetSelectedMediaItem(0,i-1)),1)
end
sel_tracks = {}
for i = 1, reaper.CountSelectedTracks(0) do
sel_tracks[i]=reaper.GetTrackGUID(reaper.GetSelectedTrack(0,i-1))
end
end
---
local function RestoreSelTracksGuid()
reaper.SetOnlyTrackSelected(reaper.GetTrack(0,0))
reaper.SetTrackSelected(reaper.GetTrack(0,0), 0)
for i = 1, #sel_tracks do
local track = reaper.BR_GetMediaTrackByGUID(0,sel_tracks[i])
if track then
reaper.SetTrackSelected(track,1)
end
end
reaper.Main_OnCommand( 40005, 0 )
reaper.PreventUIRefresh(-123456789)
end
SaveSelTracksGuid()
------------------------------------------------------------
------------ ТВОЙ СКРИПТ ------------
-----В конец----------
RestoreSelTracksGuid()
----------------------