Old 07-12-2017, 04:16 AM   #1
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default List of all running scripts in the background?

Is there a way to find out all the running (deferred) scripts?

Thanks!
__________________
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-12-2017, 04:01 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Not possible as far as I know, but it could be nice to have.
cfillion is offline   Reply With Quote
Old 07-13-2017, 04:37 AM   #3
teniente powell
Human being with feelings
 
teniente powell's Avatar
 
Join Date: Oct 2016
Location: Spain
Posts: 323
Default

In Actions List, click on "State" and all actions will be ordered by state. First the "no state" actions, after the "off" actions, and finally the "on" actions. Click on "State" again and the order turns.
teniente powell is online now   Reply With Quote
Old 07-13-2017, 05:27 PM   #4
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

For me, they show up in the Actions Menu like

Running script: blabla.lua
Running script: foo.lua

but I only use a few.
FnA is offline   Reply With Quote
Old 07-15-2017, 11:07 AM   #5
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

FnA, that's it! Thanks!
__________________
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 05-15-2018, 08:53 PM   #6
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

(sorry for bumping)

I can`t see in Action List running ReaScripts. I have almost always running multiple reascripts, and none of them are displayed as "Running ReaScript" in action list. However, ReaScript: Close all running reaScripts close these scripts.

JSFX documentaion:
Quote:
The list of scripts that are currently running in the background is available in the Actions menu
So I assume it should be an action probably?
mpl is offline   Reply With Quote
Old 05-16-2018, 05:05 AM   #7
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

I'm still on 5.79, so unless something new broke it...

__________________
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 05-16-2018, 07:15 AM   #8
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Ah thanks, I misreading (Action menu, not Action list). Anyway, I had modified menus which is the second reason i didn`t see that.
mpl is offline   Reply With Quote
Old 05-16-2018, 08:31 AM   #9
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Just had a thought. Might be nice if it were possible to check whether a given script was running via the API...
IXix is offline   Reply With Quote
Old 05-16-2018, 09:39 AM   #10
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

This is definitely a FR... and a good one....
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-16-2018, 10:23 AM   #11
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quote:
Originally Posted by IXix View Post
Just had a thought. Might be nice if it were possible to check whether a given script was running via the API...
yeah kinda reaper.GetToggleCommandState( command_id ) == 2 if given id is a currently running reascript
mpl is offline   Reply With Quote
Old 12-08-2021, 09:12 AM   #12
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,131
Default

Scripters could just agree to store their deferred scripts data (section ID, command ID, name and full path) as an extended state, as a matter of courtesy, e.g.

PHP Code:
function defer_store()

local is_new_valuefullpathsectionIDcmdIDmoderesolutionval reaper.get_action_context()

-- 
Find first available slot
local i 
1
    repeat 
    local state 
reaper.GetExtState(os.date('%x'), 'defer'..i)
        if 
#state == 0 then break end
    
i+1
    until 
#state == 0

reaper.SetExtState(os.date('%x'), 'defer'..itable.concat({sectionIDcmdIDfullpath:match('.+[\\/](.+)'), fullpath}, ';'), false)

return 
i

end


-- Store
local defer_data_slot 
defer_store()


-- 
Extract
local i 
1
    repeat 
    local sectionID
cmdIDnamefullpath reaper.GetExtState(os.date('%x'), 'defer'..i):match('(.+);(.+);(.+);(.+)')
        if 
not sectionID then break end
    i 
i+1
    until not sectionID


-- Delete
reaper
.atexit(reaper.DeleteExtState(os.date('%x'), 'defer'..defer_data_slottrue)) 
__________________
https://github.com/Buy-One/REAPER-scripts (175)
REAPER is a DAW whose user guide file is larger than its installation file

Last edited by Buy One; 12-08-2021 at 11:03 AM.
Buy One is offline   Reply With Quote
Old 12-08-2021, 11:13 AM   #13
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
Default

That seems a lot to expect. Would be great to have a way to detect all deferred via the API
MonkeyBars is offline   Reply With Quote
Old 12-08-2021, 01:56 PM   #14
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Buy One View Post
Scripters could just agree to store their deferred scripts data (section ID, command ID, name and full path) as an extended state, as a matter of courtesy, e.g.

PHP Code:
function defer_store()

local is_new_valuefullpathsectionIDcmdIDmoderesolutionval reaper.get_action_context()

-- 
Find first available slot
local i 
1
    repeat 
    local state 
reaper.GetExtState(os.date('%x'), 'defer'..i)
        if 
#state == 0 then break end
    
i+1
    until 
#state == 0

reaper.SetExtState(os.date('%x'), 'defer'..itable.concat({sectionIDcmdIDfullpath:match('.+[\\/](.+)'), fullpath}, ';'), false)

return 
i

end


-- Store
local defer_data_slot 
defer_store()


-- 
Extract
local i 
1
    repeat 
    local sectionID
cmdIDnamefullpath reaper.GetExtState(os.date('%x'), 'defer'..i):match('(.+);(.+);(.+);(.+)')
        if 
not sectionID then break end
    i 
i+1
    until not sectionID


-- Delete
reaper
.atexit(reaper.DeleteExtState(os.date('%x'), 'defer'..defer_data_slottrue)) 
My Ultraschall-Api has a more powerful defer-function that does exactly that,by storing a guid.
Though retrieving the other information isn't implemented yet, but would be easy to do.

However, I think, Reaper could benefit from giving each script-instance a unique guid, which can be enumerated by a function.
And a GetSetScriptInstance-function, that allows getting various infos of the script-instance by passing the script-instance-guid to it.

For instance, getting the hwnd of an opened gui-window.
Or the terminate/new instance-setting.
Or section, cmdid.
Etc.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine 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 01:45 AM.


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