|
|
|
07-09-2019, 12:14 AM
|
#1
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
|
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
|
|
|
07-09-2019, 01:08 AM
|
#2
|
Human being with feelings
Join Date: Oct 2016
Location: Spain
Posts: 323
|
Run action "SWS/S&M: Set global startup action" for any project, or "SWS/S&M: Set project startup action" for one project.
|
|
|
07-09-2019, 03:01 AM
|
#3
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,239
|
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
|
|
|
07-09-2019, 01:40 PM
|
#4
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
|
awesome yay !!
thanks a lot for helping out
regards
zook
|
|
|
07-11-2019, 12:28 PM
|
#5
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
@heda
What effect has setting the parameter flags to -1 in your code?
|
|
|
07-11-2019, 03:14 PM
|
#6
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,239
|
Quote:
Originally Posted by mespotine
@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.
|
|
|
07-16-2019, 11:51 AM
|
#7
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
|
Quote:
Originally Posted by heda
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
|
|
|
07-17-2019, 07:59 AM
|
#8
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Geez, I had hope....
and there's a crying smiley missing in this forumssoftware...
|
|
|
07-17-2019, 10:17 AM
|
#9
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
|
the global startup SWS command worked flawlessly.
Is there a way to add more than one startup command as well ?
zook
|
|
|
07-17-2019, 10:24 AM
|
#10
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Only with one script, in which you add all the ones you want to load and running this script by SWS.
|
|
|
07-17-2019, 11:03 AM
|
#11
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
|
Oh ok will do
|
|
|
07-17-2019, 01:09 PM
|
#12
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,239
|
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.
|
|
|
07-17-2019, 01:21 PM
|
#13
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
|
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.
|
|
|
07-17-2019, 01:40 PM
|
#14
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,239
|
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)
|
|
|
07-17-2019, 01:52 PM
|
#15
|
Human being with feelings
Join Date: Mar 2015
Location: India Mumbai
Posts: 816
|
Quote:
Originally Posted by heda
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
|
|
|
10-03-2019, 08:30 AM
|
#16
|
Human being with feelings
Join Date: Sep 2019
Posts: 1,134
|
Is this function only available in the latest build?
|
|
|
10-03-2019, 08:46 AM
|
#17
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Quote:
Originally Posted by Buy One
Is this function only available in the latest build?
|
It's been there for at least a year.
|
|
|
10-03-2019, 10:39 AM
|
#18
|
Human being with feelings
Join Date: Sep 2019
Posts: 1,134
|
Quote:
Originally Posted by Lokasenna
It's been there for at least a year.
|
alright, thank you for the info
|
|
|
10-04-2019, 07:11 AM
|
#19
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by Buy One
Is this function only available in the latest build?
|
__startup.lua and __startup.eel are in there for at least three years, probably longer.
We use it for our Ultraschall-extension for some years now.
Main_OnCommand is available for even longer.
|
|
|
06-24-2020, 10:58 AM
|
#20
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
I'm wondering if there is a way to execute a script on EVERY projet load, including in new tab?
The __startup.lua script and SWS global startup option are calling script only on Reaper load and the SWS project startup option is project dependent.
I would need something in the middle, something that execute a script for EVERY projets: existing ones, new ones, open in a tab or not.
Thank you!
|
|
|
06-25-2020, 08:28 AM
|
#21
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Infrabass
I'm wondering if there is a way to execute a script on EVERY projet load, including in new tab?
The __startup.lua script and SWS global startup option are calling script only on Reaper load and the SWS project startup option is project dependent.
I would need something in the middle, something that execute a script for EVERY projets: existing ones, new ones, open in a tab or not.
|
What does the script (that you want to execute) do exactly? Can you post more details?
|
|
|
06-25-2020, 09:13 AM
|
#22
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by Infrabass
I'm wondering if there is a way to execute a script on EVERY projet load, including in new tab?
The __startup.lua script and SWS global startup option are calling script only on Reaper load and the SWS project startup option is project dependent.
I would need something in the middle, something that execute a script for EVERY projets: existing ones, new ones, open in a tab or not.
Thank you!
|
I'll write you something.
|
|
|
06-25-2020, 09:52 AM
|
#23
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
Quote:
Originally Posted by solger
What does the script (that you want to execute) do exactly? Can you post more details?
|
Actually it's pretty complex to explain. Basically I created a script to manage the way Reaper is copying the files into the project folder (called on each manual project save).
2 reasons for this:
- Because the option "copy media to project folder” failed to copy item pasted from an other Reaper project tab
- Because I copy the files into specific folders depending of its purpose: "Imported", "Reference" and "Internal". That way, I can easily see what were my sources for a given session because they are isolated from the internal glueing/printing files and the reference files (used to compare previous audio assets with the one I need to design).
So when I reopen a project where the files were managed that way I need to relink the items now offline with the copied source file now into the project folder.
And I want that process to be streamlined, so I even don't think about it.
Hope I was clear enough! :-)
|
|
|
06-25-2020, 09:56 AM
|
#24
|
Human being with feelings
Join Date: Apr 2014
Posts: 398
|
Quote:
Originally Posted by Meo-Ada Mespotine
I'll write you something.
|
Wow!
Very nice of you Mespotine!
Actually I found that I can set a project startup action on a template project and that when saved as a new project it keeps the startup project action set via the SWS action. So using that system it works really well!
Actually I have another question for you but it will be on another thread or maybe on the Reaper slack!
:-)
Cheers!
|
|
|
07-24-2022, 06:12 AM
|
#25
|
Human being with feelings
Join Date: Sep 2021
Location: Berlin
Posts: 1,935
|
Reviving this, and the project template idea is also good, but here is an extension to run a script when any project loads.
|
|
|
09-28-2022, 10:06 AM
|
#26
|
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
|
I am experimenting with __start.lua
I have two scripts which have GUIs and are programmed to be docked when they are run.
If I add one of these as the SWS Global Startup then it is loaded and docked and waits for user input. All as intended.
If I put in __start/lua instead (having removed it from SWS Global) then, on start-up, it is loaded and docked. But its tab in the Docker is then selected and I have to click another tab to get the one I want.
Is there any was to stop that script's tab being selected?
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
|
|
|
09-28-2022, 12:49 PM
|
#27
|
Human being with feelings
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
|
Instead of putting multiple scripts into one global script, you can use a simple native custom action and put all the scripts into that. I use it this way.
|
|
|
09-28-2022, 02:02 PM
|
#28
|
Human being with feelings
Join Date: Jan 2020
Location: In the studio at my desk
Posts: 360
|
I have been using the Start.lua for a few months now, but no matter how the script requests are oriented Track_Tags always take focus. I would prefer it to be HEDA TrackInsp
reaper.Main_OnCommand( reaper.NamedCommandLookup("_RSaea4bc032a8e5652fe85 818e22f6a1a1b38557f3"), 0) -- TRACK_TAGS
reaper.Main_OnCommand( reaper.NamedCommandLookup("_RS5d05bf5141d15a2fac58 7ca059eadcb12277ff84"), 0) -- Fabian_MFXlist
reaper.Main_OnCommand( reaper.NamedCommandLookup("_RS490460a16d7e7bb0285c cb1891b67f8f59593a61"), 0) -- QUCIK_ADDER
reaper.Main_OnCommand( reaper.NamedCommandLookup("_RS5b8bf3e80fd3616513f9 eb382b4923402608cfc8"), 0) -- HeDa_TrackInsp
Will the -1, -2 etc instead of , 0) resolve this?
Thanks
Warren
|
|
|
09-29-2022, 04:06 AM
|
#29
|
Human being with feelings
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
|
Quote:
Originally Posted by bFooz
Instead of putting multiple scripts into one global script, you can use a simple native custom action and put all the scripts into that. I use it this way.
|
Hmm, I created a new Custom Action with the 2 scripts in it. Then selected that Custom Action as the SWS Global Start-up. On start up, Reaper got to the prompt to Save a new project, as usual. After that Reaper did not respond to any clicks and used 75% CPU! I had to terminate the task from the Task Manager. That's a first for me.
Oddly, I could not find the Custom Action (to remove it) nor where it is stored in the SWS ini files. I had to rename the SWS dll file, restart Reaper, delete the Custom Action, close Reaper, restore the SWS dll, restart Reaper.
So it does not seem that I can run 2 scripts on startup without them both being focussed in the Dockers. I wonder what the second parameter in the reaper.Main_OnCommand() does; it is not documented.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
|
|
|
09-29-2022, 05:16 AM
|
#30
|
Human being with feelings
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
|
I have 12 scripts starting up in the startup custom action. But only one of them is graphical, the rest is just deferred without ui.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 09:13 AM.
|