Old 09-05-2019, 01:06 PM   #1
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 684
Default [Solved - massive brain fart] Error using a simple Main_OnCommand

Hey guys,

Are you able to get this simple command to run inside a script? I keep getting a "Script.lua:44: bad argument #2 to 'Main_OnCommand' (number expected, got no value)" error:

Code:
reaper.Main_OnCommand(41295) -- duplicate items
Even doing it as a 1 line script gives the error.

Any ideas?
__________________
Cheers,
Andrew K
v5.982/64 Mac 10.12.+, i7 Quad 2.9GHz, 24GB

Last edited by Thonex; 09-05-2019 at 05:28 PM.
Thonex is online now   Reply With Quote
Old 09-05-2019, 01:15 PM   #2
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,364
Default

You need to pass the second parameter
Try
reaper.Main_OnCommand(41295, 0)
heda is offline   Reply With Quote
Old 09-05-2019, 01:16 PM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,868
Default

Quote:
Originally Posted by Thonex View Post
Code:
reaper.Main_OnCommand(41295) -- duplicate items
The flag argument is not optional, just use 0 for that.

Code:
reaper.Main_OnCommand(41295,0)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 09-05-2019, 01:33 PM   #4
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 684
Default

OMG....

MASSIVE brain fart!!

It's amazing how you can be blind to something when it's right there in front of you!

Thanks guys.

I've only used that command 385847 times LOL.
__________________
Cheers,
Andrew K
v5.982/64 Mac 10.12.+, i7 Quad 2.9GHz, 24GB
Thonex 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 06:23 PM.


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