Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 07-04-2017, 11:35 AM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default more automatic scripts like __startup

It would be great to have, in addition to __startup, the option to the following scripts as well:
__atexit.lua|.eel - will be automatically run at exit of Reaper
__onprojectload.lua|.eel - will be automatically run, if a new project is loaded
__onprojectloadtab.lua|.eel - will be automatically run, if a new project is loaded as tab
__onprojectclose.lua|.eel - will be automatically run, if a project is closed
__onprojectclosetab.lua|.eel - will be automatically run, if a projecttab is closed

So I can setup certain things automatically, or clean up after myself(closing running scripts, etc). I often want to setup things and hardware individually and can't do it without them in the way I need it. Project-Templates isn't enough for that case, as I need to run scripts at project load AND projectunload, as well at exit of Reaper to finish it all up.

It would be great to have these scripts as well....
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-04-2017, 03:13 PM   #2
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
Default

hi it's possible right now using defer()
__________________
My Reapack Repo
Donation
me2beats is offline   Reply With Quote
Old 07-04-2017, 09:50 PM   #3
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

+1

I had no idea we had a __startup script. Now I'm thinking of ways to use it already. The more the merrier.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 07-08-2017, 12:20 PM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

@me2beats
In parts, yes, but it's hard to do, as I have no individual project-IDs for the projects, only their ReaperProject-numbers(with 0 for the current acitve one).

Imagine the following:

I open a new project, the defer-script checks if it has been opened yet, which can be done using functions that manage ReaperProject as a type.

Now open several others as tabs. It still is easy to see, that new projects have been opened.

Now move the last projecttab to be the first, so every other project moves one "slot" further.

As I have only the Projectnumber (0 for the current one), and not an individual project-ID, I either risk assuming all of them have been opened at once or I have to program a difficult logic, that takes care of the reordering of the projects.
But how, I have no Project-ID to check?

With __onprojectload.lua|.eel etc it would be done by Reaper, when it's needed, with the project that needs them.


And, I don't waste processing power for that check
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-09-2017, 10:25 PM   #5
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Nice idea! I think it should be fast and easy to code for the devs too
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 07-10-2017, 06:46 AM   #6
me2beats
Human being with feelings
 
me2beats's Avatar
 
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
Default

Quote:
Originally Posted by mespotine View Post
I have no individual project-IDs for the projects
Code:
retval, projfn reaper.EnumProjects( idx, projfn )
I think this should help.
__________________
My Reapack Repo
Donation
me2beats is offline   Reply With Quote
Old 07-15-2017, 02:03 PM   #7
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Thanks, tried it and having the project-filename helps a little, though still, if someone uses save-as to save the project under a different name, even in another folder, it's difficult to detect.

If it were only on my computer, I could hack around it, but I need it to write some fancy stuff for usage by other users as well...
If Reaper starts the scripts on it's own, it would always work as I need it, cause Reaper knows best

But thanks for pointing the function out, hadn't seen it yet and there's other cool stuff I can do with it

@amagalma

Yes, it should be an easy addition and it opens up many cool use-cases not possible until now.
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-20-2018, 05:28 PM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Bump

plus the idea, that reaper.get_action_context should return the ReaProject-object of the closed/opened project as well.
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-11-2019, 12:04 PM   #9
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Great suggestions!
+1
spk77 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 02:05 PM.


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