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

Reply
 
Thread Tools
Old 12-21-2024, 04:10 AM   #1
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 4,679
Default API:set_action_options value to cancel new instance [IMPLEMENTED 7.31]

Full request sounds like this: add a possibility to use set_action_options API function for NOT terminating already running script and auto-cancel launching new instance.


When we run background script, there are three options:

- terminate instance (set_action_options flag&1 and flag1|2 to terminate and re-launch)
- new instance. This option not available to set via API.
- cancel. This option not available to set via API.

I`m interested in third option. Why?
I`m making a visual notification script with ReaImGui. If I set flag = 1|2, it stops already running script, so all the UI are switched off, the it runs again. This makes notification flickering at the moment of script termination and re-launching again, if the user triggers script multiple times a second. So ReaImGui lost frame at the moment of terminating/relaunching step.

EDIT: see mpl_NOtification.lua - https://github.com/MichaelPilyavskiy...tification.lua
__________________
My musicMPL Scripts discussionTelegramBoosty

Last edited by mpl; 01-28-2025 at 12:45 AM.
mpl is offline   Reply With Quote
Old 12-22-2024, 07:54 AM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Somewhere over the Rainbow
Posts: 6,966
Default

+1
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-26-2025, 09:39 AM   #3
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,809
Default

Hmm if we had the option for scripts to completely ignore re-execute, then there would be no way for the user to terminate a misbehaving script. hmmmmm.

edit: ah, pointed out to me the action to close all reascripts would still work. ok.

Last edited by Justin; 01-26-2025 at 06:05 PM.
Justin is offline   Reply With Quote
Old 01-28-2025, 12:46 AM   #4
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 4,679
Default

thanks!

(implemented in 7.31 rc1)
__________________
My musicMPL Scripts discussionTelegramBoosty
mpl is offline   Reply With Quote
Old 01-28-2025, 04:28 AM   #5
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,680
Default

I wonder if there is a way to do this:

if previous instance of the plugin is running, and docked and script tab is the active tab in the dock: terminate script instance and terminate previous running instance.
and
if previous instance of the plugin is running, and docked and script tab is NOT the active tab in the dock: cancel the new instance and set the previous running instance tab active

this is how the mixer or other REAPER windows do. ie: if I have multiple windows docked at the bottom, and the mixer is there, but not the active tab, if I run the action to show the mixer, it changes the active tab to the mixer. if the active tab is the mixer already, it closes the mixer.
heda is offline   Reply With Quote
Old 02-11-2025, 01:19 AM   #6
nvk
Human being with feelings
 
nvk's Avatar
 
Join Date: Jul 2019
Posts: 252
Default

Could we please get an option to set 'new instance' via the api? It's useful for scripts that take a while to load since you can keep them running in the background and then reactivate them with a new instance that just tells the script to reload if it's already open.
nvk is offline   Reply With Quote
Old 07-17-2025, 07:27 AM   #7
odedd
Human being with feelings
 
Join Date: Dec 2019
Posts: 396
Default

Quote:
Originally Posted by nvk View Post
Could we please get an option to set 'new instance' via the api? It's useful for scripts that take a while to load since you can keep them running in the background and then reactivate them with a new instance that just tells the script to reload if it's already open.
+1 for that please.

Thank you!
odedd is offline   Reply With Quote
Old 07-21-2025, 04:20 PM   #8
nvk
Human being with feelings
 
nvk's Avatar
 
Join Date: Jul 2019
Posts: 252
Default

Quote:
Originally Posted by odedd View Post
+1 for that please.

Thank you!
Maybe we need to make a new thread for this, since this one is labeled as IMPLEMENTED
nvk is offline   Reply With Quote
Old 07-21-2025, 08:04 PM   #9
odedd
Human being with feelings
 
Join Date: Dec 2019
Posts: 396
Default

Quote:
Originally Posted by nvk View Post
Maybe we need to make a new thread for this, since this one is labeled as IMPLEMENTED
I actually did it already a couple days ago here for the same reason
odedd is offline   Reply With Quote
Reply

Thread Tools

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 09:22 AM.


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