i have a bunch of custom actions and scripts to help navigate projects with a lot of tracks. i'm finding that i'm often hiding hundreds of tracks and culling my view down to just a few tracks for immediate editing.
the problem at hand is that, when i hide most of the tracks, the remaining few wind up wholly or partially off screen someplace. there is an action to scroll selected tracks into view. problem here is that these remaining tracks are not selected. there appears to be no action to scroll visible tracks into view. i suppose i could make a script that selects only the visible tracks and pair that with the 'scroll selected tracks' action into a new custom action. thought there might already be a way to do this, though, so i figured i should ask. is there? is there a better way to try to implement this?
edit:
this selects the visible tracks:
Code:
function main()
reaper.Undo_BeginBlock() -- Begining of the undo block. Leave it at the top of your main function.
local TrxTotal = reaper.CountTracks( 0 )
for i = 0, TrxTotal - 1 do -- loop through tracks
local TrkCurr = reaper.GetTrack( 0, i ) -- set variable for current track
local Visible = reaper.GetMediaTrackInfo_Value( TrkCurr, "B_SHOWINTCP" )
if Visible == 1 then
reaper.SetMediaTrackInfo_Value( TrkCurr, "I_SELECTED", 1 )
end
end
reaper.Undo_EndBlock( "Loop through visible tracks to set selected", -1 ) -- End of the undo block. Leave it at the bottom of your main function.
end
reaper.PreventUIRefresh(1) -- Prevent UI refreshing. Uncomment it only if the script works.
main() -- Execute your main function
reaper.TrackList_AdjustWindows(false)
reaper.PreventUIRefresh(-1) -- Restore UI Refresh. Uncomment it only if the script works.
thanks,
babag