Old 03-15-2017, 08:38 PM   #1
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 2,497
Default how to : set time selection to region?

Hello! i would like make a modifier for the ruler context on double click to "set time selection to region" which is an option i find in the list, but i need to have also another action and so i have to make a custom action, which would do 2 actions:
set time selection to region
Markers add/move Marker 1 to play/edit cursor

The problem is that i can't find this "set time selection to region" in scripts lists so i wonder if there is an alternative way

Thanks!
deeb is offline   Reply With Quote
Old 03-16-2017, 04:49 AM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,197
Default

To trigger native main section actions from within scripts you can use

Main_OnCommand() and Main_OnCommandEx()

https://www.extremraym.com/cloud/rea...Main_OnCommand
nofish is online now   Reply With Quote
Old 03-16-2017, 08:14 AM   #3
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 2,497
Default

Quote:
Originally Posted by nofish View Post
To trigger native main section actions from within scripts you can use

Main_OnCommand() and Main_OnCommandEx()

https://www.extremraym.com/cloud/rea...Main_OnCommand
Hi! thanks for the Input! i have no idea how to do this at this moment, but just the fact that is possible, you made my day

Edit: any idea how to know the command id?

Last edited by deeb; 03-16-2017 at 08:59 AM.
deeb is offline   Reply With Quote
Old 03-16-2017, 09:45 AM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,197
Default

You get the command ID from the action list in Reaper, there's a "Command ID" section.
So for example a simple Lua script triggering "Markers: Add/move marker 1 to play/edit cursor" (Command ID 40657) would be:

Code:
reaper.Main_OnCommand(40657, 0)
nofish is online now   Reply With Quote
Old 03-16-2017, 10:20 AM   #5
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 2,497
Default

Quote:
Originally Posted by nofish View Post
You get the command ID from the action list in Reaper, there's a "Command ID" section.
So for example a simple Lua script triggering "Markers: Add/move marker 1 to play/edit cursor" (Command ID 40657) would be:

Code:
reaper.Main_OnCommand(40657, 0)
many many many thanks! all good

Edit: hmm there is no "set time selection to region" script to know an id! maybe i am missing something : (
deeb is offline   Reply With Quote
Old 11-28-2019, 09:44 AM   #6
Buy One
Human being with feelings
 
Join Date: Sep 2019
Posts: 84
Default

No actions dealing with setting region to loop or time selection or both are available in the actions list.

I resolved this conundrum with a macro using X-Raym's scripts

Quote:
X-Raym_Move edit cursor to start of region under play or edit cursor.eel
Time selection: Set start point
X-Raym_Move edit cursor to end of region under play or edit cursor.eel
Time selection: Set end point
Cursor must be placed within region first

And then cfillion suggested another script by Thonex "Set time selection to region at edit cursor"
Buy One is offline   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:08 PM.


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