Lua Scripting with REAPER 5 - Part. 8: Using Native Actions
-
0:00 - 0:04Hi, this is X-Raym, for the 8th part
of our ReaScript tutorial. -
0:04 - 0:08Today, we will use a REAPER
native action inside our script. -
0:08 - 0:12I will make this script select items
on which it has an effect. -
0:12 - 0:15The function is the following.
-
0:26 - 0:30Here I need an item, and my items
are put in the variable item -
0:30 - 0:34and for bolean selected, I put
either true or false, so I put true -
0:34 - 0:38As I want my item to be selected
if they pass through here. -
0:38 - 0:40If I run the script...
-
0:42 - 0:44we see that the items get selected.
-
0:44 - 0:47However, the previous ones
didn't get unselected. -
0:47 - 0:50There is several way we can make it,
-
0:50 - 0:55but I'll show you one, that will
make you learn something new. -
0:55 - 1:00We can run inside a script
actions coming from the actions list -
1:00 - 1:02If we now their command ID.
-
1:02 - 1:04So, I will search for the action
-
1:04 - 1:07Unselect all items.
-
1:07 - 1:10I copy its ID.
-
1:12 - 1:15And I will paste it temporary...
-
1:15 - 1:17either here or here, it would have
the same result. -
1:17 - 1:21So I put here here. Temporary.
-
1:21 - 1:29And I will look for the function called
Main_OnCommand -
1:30 - 1:37which allow me to run
a REAPER action, within the script. -
1:38 - 1:42As first parameter, the command ID
of the action -
1:42 - 1:45as 2nd parameters, I put 0.
-
1:45 - 1:50A bit complicated to explain but most
of the time, 0 will be just fine. -
1:50 - 1:51I select all.
-
1:51 - 1:57If I run the script, we see that the item
in time selection get selected. -
1:57 - 2:01If I extend the time selection...
-
2:02 - 2:04Inside the time selection
and on selected track! -
2:04 - 2:07If I unselect this track...
-
2:07 - 2:08and I run the script again...
-
2:08 - 2:10This item get unselected.
-
2:10 - 2:15In the next episode, we will see how to prevent
errors that may be caused by our script.
- Title:
- Lua Scripting with REAPER 5 - Part. 8: Using Native Actions
- Description:
-
Source Article and Exercice:
http://extremraym.com/en/reascript-video-using-native-actionsPlease consider making a donation if you liked it:
http//extremraym.com/en/donationCheers !
- Video Language:
- French
- Duration:
- 02:17
Extrem Raym edited English, British subtitles for Lua Scripting with REAPER 5 - Part. 8: Using Native Actions |