Can't get Main.On_Command to work :/
What's even weirder is that in the script I'm currently writing, it's two 'Main.OnCommand's, the first one works, the second doesn't. Here's my current code.
__________________________________________________ ___________________
-- duplicate selected midi item
reaper.Main_OnCommand(41295, 0) --Edit: Duplicate Events
-- open MIDI Editor
reaper.Main_OnCommand(40716, 0) -- View: Toggle show MIDI editor windows
__________________________________________________ _______________________
Basically it is supposed to just duplicate the selected midi item on the timeline, then it's supposed to open the MIDI editor for that duplicated item.
I have never used Lua or ReaScript before, but i've used several other languages before, i'm basically just using this script to get started learning, so my apologies if there is some dumb mistake i'm making. I also included the script as an attachment.
I'm just pretty confused why the first one will work, but not the second.
Also, another question i had, is there a way to debug these scripts? The biggest issue i've been having working with lua/reascript is that there doesen't really seem to be a way to actually walk through your code and debug it, even the "OnCommand" function doesen't return a boolean if it performed it's action or not.
Any help would be much appreciated!
Last edited by Lamerak; 05-30-2021 at 10:41 AM.
|