Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 08-07-2022, 03:27 AM   #1
Gass n Klang
Human being with feelings
 
Gass n Klang's Avatar
 
Join Date: Nov 2015
Location: Cologne
Posts: 1,636
Default Item navigation: Select and move to next item (cursor stays in center of screen)

hey guys,
I need a two scripts that do what "Item navigation: Select and move to next/previous item" does but I'd like the cursor to stay always in the middle of the screen.
Would be super kind if anybody could code that.

At the moment if there is more than one item in a "one screen view" then the edit cursor just moves. If your jump back and forth between items fast, then it's a bit distracting.
__________________
https://juliusgass.de
Gass n Klang is online now   Reply With Quote
Old 08-07-2022, 05:23 AM   #2
Faberman
Human being with feelings
 
Join Date: Jul 2018
Posts: 16
Default

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 )
Faberman is offline   Reply With Quote
Old 08-07-2022, 05:49 AM   #3
Gass n Klang
Human being with feelings
 
Gass n Klang's Avatar
 
Join Date: Nov 2015
Location: Cologne
Posts: 1,636
Default

perfect. thanks a whole lot!
__________________
https://juliusgass.de
Gass n Klang is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.