Old 05-24-2015, 05:49 AM   #1
pangrawit
Human being with feelings
 
pangrawit's Avatar
 
Join Date: May 2015
Posts: 6
Default How to run a script on every Reaper startup

Hi,

It seems a most simple question to me, but I couldn't find the answer.

>>>
So hello to everyone! I've been a regular visitor here for many months now. I've found tons of answers without even having to ask questions, so thank you all for your excellent work!
<<<

So now that's what I want to do:
I have an EEL script loaded into my actions list. I can select it and hit run and it works. But only until I close Reaper. When I reopen I have to run it again. I want it to run automatically when I start Reaper. How do I do it?

Many thanks!
Jacek
pangrawit is offline   Reply With Quote
Old 05-24-2015, 07:09 AM   #2
lachrimae
Human being with feelings
 
lachrimae's Avatar
 
Join Date: May 2010
Location: Austin, TX
Posts: 791
Default

Hey Jacek,

This ability is included in SWS Extensions and is called Project Startup Action. Have a look in your extensions menu (assuming SWS is installed).

I think you can only specify a single script so if you need to run more than 1 on startup you'd need to combine them (I could be wrong).
lachrimae is offline   Reply With Quote
Old 05-24-2015, 07:12 AM   #3
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default

Yes you can combine them in a custom action.

I would love also a global startup action, that runs when REAPER starts, not project specific.
heda is offline   Reply With Quote
Old 11-14-2015, 02:49 AM   #4
pangrawit
Human being with feelings
 
pangrawit's Avatar
 
Join Date: May 2015
Posts: 6
Default

Thanks guys!
The SWS feature works great.
But I actually meant what Heda means - running scripts at Reaper startup. Or perhaps including scripts in default new project settings.
Any news on that?
pangrawit is offline   Reply With Quote
Old 11-14-2015, 03:17 AM   #5
EricM
Human being with feelings
 
EricM's Avatar
 
Join Date: Jul 2009
Location: Ljubljana, Slovenia
Posts: 3,801
Default

Here's a solution:

http://forum.cockos.com/showpost.php...1&postcount=13

Best,
e
__________________
Shoelace 4 Theme | SoundCloud/erXon
EricM is offline   Reply With Quote
Old 11-24-2015, 03:21 PM   #6
pangrawit
Human being with feelings
 
pangrawit's Avatar
 
Join Date: May 2015
Posts: 6
Default

Runs great.
Thanks!
pangrawit is offline   Reply With Quote
Old 11-25-2015, 03:13 AM   #7
drew
Mobile
 
drew's Avatar
 
Join Date: Jan 2006
Location: London & São Paulo. Hardcore commercial REAPERite
Posts: 1,669
Default

Unless I am missing something, that solution (with default project template) will only work if every project already has it and if you ever decide to stop using it, all your projects will still try to run it.

I appreciate it's given as a workaround, but is still quite different from 'when REAPER starts, run an action' (which could easily be changed globally, rather than requiring all projects to be reconfigured).
__________________
Proudly using REAPER exclusively for...
* Media and event music composition & production, sound design + auto-processing at Qsonics.com
* Broadcast branding, promos, education & training and narration voice-overs at DrewWhite.com
drew is offline   Reply With Quote
Old 11-25-2015, 10:10 AM   #8
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,672
Default

my problem with the proposed solution is that my script is meant to run indefinitely, so it works great when I launch reaper and the default project is run... but then when I create a new tab, the script runs again and turns itself off like a toggle.
mccrabney is online now   Reply With Quote
Old 11-25-2015, 12:08 PM   #9
beingmf
Human being with feelings
 
beingmf's Avatar
 
Join Date: Jul 2007
Location: Jazz City
Posts: 5,073
Default

May I ask what (kind of) script this is? Slightly OT, but I'm always interested how other users customize their Reaper setups.
__________________
Windows 10x64 | AMD Ryzen 3700X | ATI FirePro 2100 | Marian Seraph AD2, 4.3.8 | Yamaha Steinberg MR816x
"If I can hear well, then everything I do is right" (Allen Sides)
beingmf is offline   Reply With Quote
Old 11-25-2015, 12:45 PM   #10
lachrimae
Human being with feelings
 
lachrimae's Avatar
 
Join Date: May 2010
Location: Austin, TX
Posts: 791
Default

Mine is Heda's auto-record mode
http://reaper.hector-corcin.com/
lachrimae is offline   Reply With Quote
Old 11-30-2015, 02:57 AM   #11
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

I'll add a "global" startup action in SWS (in addition to the "per-project" startup action)
Jeffos is offline   Reply With Quote
Old 11-30-2015, 03:09 AM   #12
EricM
Human being with feelings
 
EricM's Avatar
 
Join Date: Jul 2009
Location: Ljubljana, Slovenia
Posts: 3,801
Default

Quote:
Originally Posted by Jeffos View Post
I'll add a "global" startup action in SWS (in addition to the "per-project" startup action)
nice Jeff :>

e
__________________
Shoelace 4 Theme | SoundCloud/erXon
EricM is offline   Reply With Quote
Old 11-30-2015, 07:30 AM   #13
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
Default

Quote:
Originally Posted by Jeffos View Post
I'll add a "global" startup action in SWS (in addition to the "per-project" startup action)
You rock, Jeffos. Thank you.
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 11-30-2015, 08:02 AM   #14
timothys_monster
Human being with feelings
 
timothys_monster's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 1,133
Default

Quote:
Originally Posted by Jeffos View Post
I'll add a "global" startup action in SWS (in addition to the "per-project" startup action)
Wow, brilliant!!! Thank you, JeffOS
timothys_monster is offline   Reply With Quote
Old 11-30-2015, 09:34 AM   #15
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default

excellent news
heda is offline   Reply With Quote
Old 12-01-2015, 11:27 AM   #16
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,672
Default

thanks a million, jeffos.

Quote:
May I ask what (kind of) script this is? Slightly OT, but I'm always interested how other users customize their Reaper setups.
it's a script that watches to see if i've changed tabs, and if i do, it "wiggles" some specific ReaControlMidi params to set some external midi equipment to the project values so that i don't have to change presets manually. right now, calling it twice acts as a on/off toggle which is undesirable. having it run via program action negates the issue as it would just bceome a "fact" of reaper.
mccrabney is online now   Reply With Quote
Old 09-27-2016, 11:50 AM   #17
radekdolezi
Human being with feelings
 
Join Date: Jul 2016
Posts: 48
Default

SWS set global stratup action works great - but ... how to set more than one action? It looks like mission impossible that way :-(
radekdolezi is offline   Reply With Quote
Old 09-27-2016, 12:22 PM   #18
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,964
Default

Quote:
Originally Posted by radekdolezi View Post
SWS set global stratup action works great - but ... how to set more than one action?
Create a REAPER custom action containing all desired actions and assign that as SWS global startup action.
cfillion is offline   Reply With Quote
Old 09-26-2018, 04:40 AM   #19
earhax
Human being with feelings
 
earhax's Avatar
 
Join Date: Nov 2015
Location: earth
Posts: 472
Default

I just wanted to say THANK YOU SO MUCH for adding this global startup action. I've been tearing my hair out needing to set a number of cycle actions I use to the "on" state every time I start REAPER. But thanks to this, NO MORE! They all turn on automatically. Hooray!
earhax is offline   Reply With Quote
Old 09-26-2018, 08:07 AM   #20
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

For completeness:

Reaper also supports a special-script called __startup.lua or __startup.eel, depending on the language you are using.
If you put one or both of them into the scripts-folder, they will be run at startup, even if they are not registered as scripts, with the __startup.eel first and __startup.lua second.

Important: the script has two underscores at the beginning!

With that, a lot is possible in "standard"-Reaper at startup as well.
Meo-Ada Mespotine is online now   Reply With Quote
Old 10-01-2018, 06:46 AM   #21
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 305
Default

Quote:
Originally Posted by mespotine View Post
Reaper also supports a special-script called __startup.lua or __startup.eel
Thanks for the info!)
Ivannn Bennnettt is offline   Reply With Quote
Old 03-25-2019, 11:27 AM   #22
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,128
Default

Quote:
Originally Posted by mespotine View Post
For completeness:

Reaper also supports a special-script called __startup.lua or __startup.eel, depending on the language you are using.
If you put one or both of them into the scripts-folder, they will be run at startup, even if they are not registered as scripts, with the __startup.eel first and __startup.lua second.

Important: the script has two underscores at the beginning!

With that, a lot is possible in "standard"-Reaper at startup as well.
Can you explain to me how this is better than SWS Global Action? I'm just always looking for ways to improve my workflow.
lexaproductions is offline   Reply With Quote
Old 03-25-2019, 01:04 PM   #23
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

- Doesn't require SWS, for the few people who won't/can't install it.
- It's a script, rather than a Reaper action, so it's able to do a lot more if you need it to.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 08-03-2019, 06:43 PM   #24
babag
Human being with feelings
 
Join Date: Nov 2009
Posts: 2,230
Default

edit: found example. very helpful. heda gives examples and useful discussion.:

https://forum.cockos.com/showthread.php?t=222833

end edit

is there an example script someplace for this so i could see how exactly to write it up? i'm sure it's very simple.

thanks,
babag

Last edited by babag; 08-03-2019 at 07:08 PM.
babag is offline   Reply With Quote
Old 08-04-2019, 03:01 AM   #25
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 546
Default

I wonder, how can I setup startup action with a script (for example KAWA Clock) already docked when launching Reaper, is it possible somehow?
Skorobagatko is offline   Reply With Quote
Old 08-06-2019, 07:43 AM   #26
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

Quote:
Originally Posted by Skorobagatko View Post
I wonder, how can I setup startup action with a script (for example KAWA Clock) already docked when launching Reaper, is it possible somehow?
What do you mean? Do you mean, how a script can change the __startup.lua? Or how to change, what the __startup.lua is starting as actions when run?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-09-2019, 02:00 AM   #27
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 546
Default

Quote:
Originally Posted by mespotine View Post
What do you mean? Do you mean, how a script can change the __startup.lua? Or how to change, what the __startup.lua is starting as actions when run?
Script opens floating on startup, but I want it to be docked. So I need to click on it and select "dock" this window each time.
Skorobagatko is offline   Reply With Quote
Old 08-09-2019, 02:05 AM   #28
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,583
Default

I would 'wrap' the script in a custom action and add an action to dock the last toolbar. (I'm pretty sure those actions exist)
__________________
Puzzle Factory Sound Studios, London [Website] [Instagram]
[AMD 5800X, 32Gb RAM, Win10x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUCX, REAPER x64]
[Feature request: More details in Undo History]
daxliniere is offline   Reply With Quote
Old 08-09-2019, 02:23 AM   #29
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default

Quote:
Originally Posted by Skorobagatko View Post
Script opens floating on startup, but I want it to be docked. So I need to click on it and select "dock" this window each time.
It depends on the script to restore last position or docker when initializing and save the position and docker when exiting.
heda is offline   Reply With Quote
Old 11-11-2020, 02:05 AM   #30
acebone
Human being with feelings
 
Join Date: Oct 2017
Location: Copenhagen, Denmark
Posts: 229
Default

Quote:
Reaper also supports a special-script called __startup.lua or __startup.eel, depending on the language you are using.
Just for completeness - this is my __startup.lua:

Code:
reaper.ExecProcess("reaper-startup.sh", 100)
I'm starting my own script "reaper-startup.sh" - but you can start anything with that.

I also need to run a script when Reaper shuts down. I do this by starting reaper from a script. When reaper is started, the script runs a loop checking if reaper is still running. When reaper is closed, the script exits the loop and runs the finishing script:

Code:
#!/bin/bash

# Send a desktop-notification
# (that way we now it's the wrapper
# starting, and not reaper on its own)
notify-send "reaper-wrapper.sh 
starter reaper 

$*"

# Start reaper
/opt/REAPER/reaper $*

# Check every second if 
# reaper is still alive
while [ $(pidof reaper) ]; do
	sleep 1
done

# Reaper has been closed
notify-send "lukker reaper ned"

# Run the script that
# restores jack-connections
# to normal use
jack-after-startup.sh

Last edited by acebone; 11-11-2020 at 02:30 AM.
acebone is offline   Reply With Quote
Old 02-19-2021, 12:34 PM   #31
xappn
Human being with feelings
 
Join Date: Feb 2021
Posts: 23
Default

Quote:
Originally Posted by Skorobagatko View Post
Script opens floating on startup, but I want it to be docked. So I need to click on it and select "dock" this window each time.
Quote:
Originally Posted by heda View Post
It depends on the script to restore last position or docker when initializing and save the position and docker when exiting.
Could you or someone further explain what is needed in the script in order to make the script automatically dock on startup?

One .lua script that I use doesn't do this, so I was wondering if it's something that I could add in it's code.
xappn is offline   Reply With Quote
Old 11-08-2021, 08:59 PM   #32
Kei.000000000001
Human being with feelings
 
Join Date: Mar 2021
Posts: 5
Default

Quote:
Originally Posted by xappn View Post
Could you or someone further explain what is needed in the script in order to make the script automatically dock on startup?

One .lua script that I use doesn't do this, so I was wondering if it's something that I could add in it's code.
I am interested as well... mainly Kawa scripts... they dont remember their docked properties
Kei.000000000001 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:57 AM.


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