Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 10-12-2018, 01:09 AM   #1
modraw
Human being with feelings
 
modraw's Avatar
 
Join Date: Oct 2017
Posts: 27
Default Display a specific window ( ie : region matrix ) only if it's not already active

Hey dear coding people.

Would you mind help a noob looking for a simple action : I'd like to display the region matrix only if it's not already visible/active ?

Thanks for the help
-modraw
modraw is offline   Reply With Quote
Old 10-12-2018, 06:24 AM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Visible should be possible, using GetToggleCommandState2:
http://mespotine.de/Ultraschall/Reap...eCommandState2

I don't have Reaper here right now, so I wrote this from memory, mostly. It should work, but if not, just follow the steps I wrote later.

Just go into the actionlist, create a new script using the NEW-button for ReaScripts.
Name the file to Show_Regionmatrix.lua. and hit Save.

Paste the following into the script-window that appears.

Code:
if reaper.GetToggleCommandState2(40251)==0 then
    reaper.Main_OnCommand(40251,0)
end
Hit Cmd+S or Ctrl+S and it should work already, everytime you hit Cmd+S or Ctrl+S.

Now, the aforementioned "later steps":
If it doesn't always show the RegionMatrix, change the

Code:
if reaper.GetToggleCommandState2(40251)==0 then
to

Code:
if reaper.GetToggleCommandState2(40251)==1 then
If it works successfully, close the window.



"Active window" isn't codeable, unfortunately. But maybe, my code is sufficient enough.
__________________
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
Old 10-15-2018, 03:37 AM   #3
modraw
Human being with feelings
 
modraw's Avatar
 
Join Date: Oct 2017
Posts: 27
Default

Hey mespotine, as you can see in the attached screen. The region render matrix doesn't seem to have a state variable.
I guess I'll have to wait for a reaper update then ?
Attached Images
File Type: png 2018-10-15 12_35_45-Actions.png (3.1 KB, 102 views)
modraw is offline   Reply With Quote
Old 10-15-2018, 08:42 AM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Hmm..seems like that. :/
__________________
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 12:15 AM.


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