Quote:
Originally Posted by Buy One
Sure, one simply has to know the syntax. Say repeat the action View: Increase selected track heights a little bit a predefined number of times
|
Code:
reaper.Undo_BeginBlock()
for i = 0, 99 do
reaper.Main_OnCommand( 41327, 0 )
end
reaper.Undo_EndBlock( "Script: View: Increase selected track heights a little bit x times ", -1 )
the it will repeat it 100 times, there are more ways to create loops in lua
https://www.youtube.com/watch?v=gi4DCaBpsnw&t=569s
The fun in reascript is reapet it according to a variable for exemple
Code:
reaper.Undo_BeginBlock()
reaper.ShowConsoleMsg( "" )
select_tracks_count = reaper.CountSelectedTracks( 0 )
for i = 0, 1000*(10^(select_tracks_count*(-1))) do
reaper.Main_OnCommand( 41327, 0 )
reaper.ShowConsoleMsg( "Number of execution is "..tostring(i+1).."\n" )
end
reaper.Undo_EndBlock( "Script: View: Increase selected track heights a little bit x times ", -1 )
The more tracks selected less it repeat the action
1track= 101 times
2 = 11
3 = 2
A silly exemple but made just to demonstrate