Old 07-09-2019, 12:14 AM   #1
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 547
Default Autoexec scripts on startup ?

Hi
I am just curious whether it is possible to auto execute a few scripts right at the start of the software ?
Though i have made tabs for the Eugen's RR scripts but this would be one scenario where it could come in handy .


regards
zook
zookthespook is offline   Reply With Quote
Old 07-09-2019, 01:08 AM   #2
teniente powell
Human being with feelings
 
teniente powell's Avatar
 
Join Date: Oct 2016
Location: Spain
Posts: 236
Default

Run action "SWS/S&M: Set global startup action" for any project, or "SWS/S&M: Set project startup action" for one project.
teniente powell is online now   Reply With Quote
Old 07-09-2019, 03:01 AM   #3
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,281
Default

create a file "__startup.lua" in the "Scripts" folder.
This will be executed on start. Inside this script you can also call other scripts for example like this:
Code:
reaper.Main_OnCommand(reaper.NamedCommandLookup("_RSe3ad1140dc733c3ccfe65a67ec53bfc634535821"), -1) --Run Track Inspector VIP
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 07-09-2019, 01:40 PM   #4
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 547
Default

awesome yay !!

thanks a lot for helping out

regards
zook
zookthespook is offline   Reply With Quote
Old 07-11-2019, 12:28 PM   #5
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,394
Default

@heda
What effect has setting the parameter flags to -1 in your code?
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 07-11-2019, 03:14 PM   #6
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,281
Default

Quote:
Originally Posted by mespotine View Post
@heda
What effect has setting the parameter flags to -1 in your code?
For more mystery... I could have used -23496 instead of -1
No idea... I can't remember why I put -1 instead of 0. I think that flag parameter is not used. It is not documented.
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 07-16-2019, 11:51 AM   #7
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 547
Default

Quote:
Originally Posted by heda View Post
For more mystery... I could have used -23496 instead of -1
No idea... I can't remember why I put -1 instead of 0. I think that flag parameter is not used. It is not documented.
hahaha
zookthespook is offline   Reply With Quote
Old 07-17-2019, 07:59 AM   #8
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,394
Default

Geez, I had hope....

and there's a crying smiley missing in this forumssoftware...
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 07-17-2019, 10:17 AM   #9
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 547
Default

the global startup SWS command worked flawlessly.
Is there a way to add more than one startup command as well ?

zook
zookthespook is offline   Reply With Quote
Old 07-17-2019, 10:24 AM   #10
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,394
Default

Only with one script, in which you add all the ones you want to load and running this script by SWS.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote
Old 07-17-2019, 11:03 AM   #11
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 547
Default

Oh ok will do
zookthespook is offline   Reply With Quote
Old 07-17-2019, 01:09 PM   #12
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,281
Default

I recommend the method of using the __startup.lua file instead of SWS. You can add as many actions in the lua file as needed. There is something with the SWS that sometimes wasn't working, at least running scripts, maybe for standard actions or custom actions is ok.
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 07-17-2019, 01:21 PM   #13
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 547
Default

ok i have no knowledge of coding at all but i tried this
made a new script _startup.lua

then added this code, copying your code line and added the scripts
Quote:
reaper.Main_OnCommand(reaper.NamedCommandLookup
("_RSe3ad1140dc733c3ccfe65a67ec53bfc634535821") , -1) --Run Track Inspector VIP
("_RS67fdf22be642a98b636a7c6eadf233e63b831d46") , -2) --Run Retrospective Record (MIDI)
("_RS6e7d8e039b636d070ecfcbf6bd71c3728658a741") , -3) --Run Retrospective Record (audio)
i tried to sneak in a "end" as well but the compiler caught my bluff ! hehe
it is showing error . it was highlighting the bracket in red near the -2 and -3
can you help me with this !

regards
zook

Last edited by zookthespook; 07-17-2019 at 01:26 PM.
zookthespook is offline   Reply With Quote
Old 07-17-2019, 01:40 PM   #14
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,281
Default

try this
also notice that the file has to have two _ underscore characters... not one. "__startup.lua"
I don't know why.



Code:
reaper.Main_OnCommand(reaper.NamedCommandLookup("_RSe3ad1140dc733c3ccfe65a67ec53bfc634535821"), 0) --Run Track Inspector VIP

reaper.Main_OnCommand(reaper.NamedCommandLookup("_RS67fdf22be642a98b636a7c6eadf233e63b831d46"), 0) --Run Retrospective Record (MIDI)

reaper.Main_OnCommand(reaper.NamedCommandLookup("_RS6e7d8e039b636d070ecfcbf6bd71c3728658a741"), 0) --Run Retrospective Record (audio)
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 07-17-2019, 01:52 PM   #15
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Posts: 547
Default

Quote:
Originally Posted by heda View Post
try this
also notice that the file has to have two _ underscore characters... not one. "__startup.lua"
I don't know why.



Code:
reaper.Main_OnCommand(reaper.NamedCommandLookup("_RSe3ad1140dc733c3ccfe65a67ec53bfc634535821"), 0) --Run Track Inspector VIP

reaper.Main_OnCommand(reaper.NamedCommandLookup("_RS67fdf22be642a98b636a7c6eadf233e63b831d46"), 0) --Run Retrospective Record (MIDI)

reaper.Main_OnCommand(reaper.NamedCommandLookup("_RS6e7d8e039b636d070ecfcbf6bd71c3728658a741"), 0) --Run Retrospective Record (audio)
oh yes ! thanks heda . trying it right away !

it worked it worked...you have taken me beyond "hello world" Really wan't to thank you for helping out here. this is going to be of great help !

regards
zook
zookthespook 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 04:22 PM.


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