Try this for the "next item". For the "previous item", the same script, just replace "40417" with "40416". I am not a scripter, but this works for me. Here is the code:
reaper.PreventUIRefresh( 1 )
reaper.Main_OnCommand(reaper.NamedCommandLookup("4 0417" ), 0, 0 )
start_time, end_time = reaper.GetSet_ArrangeView2( 0, 0, 0, 0, start_time, end_time )
wide = end_time - start_time
cursor = reaper.GetCursorPosition()
reaper.GetSet_ArrangeView2( 0, 1, 0, 0, cursor - wide/2, cursor + wide/2 )
|