Old 10-03-2019, 01:33 PM   #1
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,101
Default Toggle ALL Floating Windows for $$

We have an action to toggle all floating windows, but it doesn't always work. I'm looking for a script that can do the following:

1. If any windows are floating, save their positions and close them. This must include routing windows, undocked scripts(especially), floating toolbars and any other floating window.
2. If no windows are floating, restore the saved set.
3. Must be compatible with Esc key. This key always closes the active window by default (except for floating scripts), so the script must first take all floating windows out of focus, otherwise it will not execute the script until after it closes the focused window.
4. If there is a saved set and other windows are floating, forget the first set, save and close the currently floating windows.
5. It should not load a set of floating windows if any other window is currently floating, so not quite a pure toggle.

I was hoping to start a pool for this to get made if possible by script. I got $20 on it but if it takes more than that and no one else is interested in contributing to the pool, I'll dig deeper...

Lemme know if it's possible and/or what it would take...thx
__________________
Myy Wyyrd Muzyyk

Last edited by foxAsteria; 10-03-2019 at 06:28 PM.
foxAsteria is offline   Reply With Quote
Old 10-03-2019, 04:00 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,030
Default

@edgemeal
It can definitely be added to your repo !



Off topic:

when will you make it reapack compatible ?
X-Raym is offline   Reply With Quote
Old 10-03-2019, 04:26 PM   #3
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,101
Default

Damn dude, how did you travel back in time to whip this up before I even asked for it? Lol. Ok I can probably get used to using a different key, but I've literally been using Esc for the last 10 years so it'd be great to not have to retrain my brain.

Anyways, it's almost working. The problem I notice right away is that once I've closed the windows with it, then opened another window and closed it again with the script, all the previously closed windows open again too. This is kinda the same problem I was having before, where the last closed windows wouldn't always be the ones to open back up.

But thanks a lot dude, do you think you can fix that problem? And is Esc too hard-coded into Reaper to use for this reliably?
__________________
Myy Wyyrd Muzyyk
foxAsteria is offline   Reply With Quote
Old 10-03-2019, 04:54 PM   #4
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,365
Default

Quote:
Originally Posted by foxAsteria View Post
Damn dude, how did you travel back in time to whip this up before I even asked for it? Lol. Ok I can probably get used to using a different key, but I've literally been using Esc for the last 10 years so it'd be great to not have to retrain my brain.
LOL, had wrong date. Any key should work, its just that I often use F-keys when testing since those keys work when FX and some other windows have focus, you could use a toolbar button also.
Quote:
Anyways, it's almost working. The problem I notice right away is that once I've closed the windows with it, then opened another window and closed it again with the script, all the previously closed windows open again too. This is kinda the same problem I was having before, where the last closed windows wouldn't always be the ones to open back up.

But thanks a lot dude, do you think you can fix that problem? And is Esc too hard-coded into Reaper to use for this reliably?
The script only works with one group of windows, so what ever is visible at the time you first run the script gets hidden, and is restored when you run the script again.

Last edited by Edgemeal; 10-03-2019 at 05:02 PM.
Edgemeal is offline   Reply With Quote
Old 10-03-2019, 05:55 PM   #5
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,365
Default

Code removed

Last edited by Edgemeal; 10-04-2019 at 01:28 PM. Reason: CODE TWEAKS
Edgemeal is offline   Reply With Quote
Old 10-03-2019, 06:25 PM   #6
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,101
Default

Quote:
Originally Posted by Edgemeal View Post
The script only works with one group of windows, so what ever is visible at the time you first run the script gets hidden, and is restored when you run the script again.
Thanks, yea I only need one group at a time, but I would need it to forget that first group of windows if I open any other floating windows. Otherwise if there is a saved set, when I try to close the currently floating windows, I instead get the old windows restored on top and it keeps adding more and more windows to the group unless I manually close them before running it.

So I feel like I'm just badly explaining what I need. I've edited the OP to (hopefully) clarify.

Found a bug: Click two fx in the mixer to float them. Run the script to close them. Click one of those same fx to float it (nothing happens). Run the script and only the other fx opens. So apparently Reaper thinks the fx is still floating when the script has hidden it.

If this is not possible (esp the part about closing other floating script windows), please don't let me waste any more of your time. I feel bad when I ask for scripts and don't explain clearly enough what I need, only find out it's not quite possible after someone has spent some time. I did this to you just recently, didn't I? Really sorry about that...
__________________
Myy Wyyrd Muzyyk
foxAsteria is offline   Reply With Quote
Old 10-03-2019, 06:36 PM   #7
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,365
Default

I'll just stop here cause I don't think I can make a script to do what you want. Best of luck!
Edgemeal is offline   Reply With Quote
Old 10-03-2019, 06:40 PM   #8
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,101
Default

Damn dude. I hope you're not mad. Sorry and thanks a lot for trying.
__________________
Myy Wyyrd Muzyyk
foxAsteria is offline   Reply With Quote
Old 10-03-2019, 06:43 PM   #9
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,365
Default

Quote:
Originally Posted by foxAsteria View Post
Damn dude. I hope you're not mad. Sorry and thanks a lot for trying.
No not at all, I'm going to use this. This script is sort of like Windows 'Peek' (to preview desktop), but for REAPER.
Edgemeal is offline   Reply With Quote
Old 10-03-2019, 06:48 PM   #10
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,101
Default

Ok well I see you just added support for closing floating scripts. That's definitely helpful to me.

If you could possibly turn this into a one-way street (close only) and also let Reaper know about that so there's not that bug I mentioned, I don't really care that much about re-opening them. I can do that manually if necessary.

And I can put it into a custom action to focus the main window first (I had to do this before in order for Esc to work properly) and it will definitely be useful to me. I'll def use it then and be happy to send you some money... You can still say no.
__________________
Myy Wyyrd Muzyyk
foxAsteria is offline   Reply With Quote
Old 10-03-2019, 06:57 PM   #11
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,365
Default

Code removed

Last edited by Edgemeal; 10-04-2019 at 01:28 PM.
Edgemeal is offline   Reply With Quote
Old 10-03-2019, 07:09 PM   #12
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,101
Default

Well almost, but damn those pesky floating scripts! Nothing gets past them unless I click the main window first. Even global scope is no help. Is that something that can only be dealt with by the individual scripts? Is there a line of code I could add to those that would force Esc to get past them?
__________________
Myy Wyyrd Muzyyk
foxAsteria is offline   Reply With Quote
Old 10-03-2019, 07:34 PM   #13
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,365
Default

Quote:
Originally Posted by foxAsteria View Post
Well almost, but damn those pesky floating scripts! Nothing gets past them unless I click the main window first. Even global scope is no help. Is that something that can only be dealt with by the individual scripts? Is there a line of code I could add to those that would force Esc to get past them?
Ya I see same problem using F12, can only guess windowed scripts block/eat the keyboard keys so shortcuts never get seen by REAPER.

I don't use any windowed scripts, but if it uses a defer loop then it should be pretty simple to make them exit on ESC key, just looked at a script called 'TakeCommenter.lua' all I had to do was add one line of code to make it close on ESC key when it has focus, or you could call the close all windows script when ESC key is detected, but that would be hassle to maintain as you'd have to update the scripts every time they were updated.

BEST OF LUCK!

Last edited by Edgemeal; 10-04-2019 at 01:28 PM.
Edgemeal is offline   Reply With Quote
Old 10-06-2019, 02:19 PM   #14
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,101
Default

Hey duder, would you mind giving this close all float script an undo point, please? Could work as at least a partial toggle. I send you a donation as thanks, btw.

Also, what was that line of code to make Esc work on floating scripts? There're only a few that I would need to add it to and I don't think they're currently being developed.
__________________
Myy Wyyrd Muzyyk
foxAsteria is offline   Reply With Quote
Old 10-06-2019, 03:35 PM   #15
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,365
Default

Quote:
Originally Posted by foxAsteria View Post
Hey duder, would you mind giving this close all float script an undo point, please? Could work as at least a partial toggle. I send you a donation as thanks, btw.

Also, what was that line of code to make Esc work on floating scripts? There're only a few that I would need to add it to and I don't think they're currently being developed.

PM Sent.

If you really wanted ESC key to close all windows (instead of just the floating script that has focus) you could call my script. For the script I mentioned above I find the gfx.getchar() command and then add code to detect ESC key, will look something like...

Code:
function mainloop()
  hotkey = gfx.getchar() ---this is  already in the script
  if hotkey == 27 then -- Add... Call Script: Close  All Windows.lua, and exit loop!
    reaper.Main_OnCommand(reaper.NamedCommandLookup('_RS1234567890'), 0) -- Script: Close  All Windows.lua
    return -- exit defer loop!
  end
  reaper.defer(mainloop)
end
You would need to edit and change the ID (starts with _RS) since it will likely be different on your PC.

Last edited by Edgemeal; 10-06-2019 at 03:44 PM.
Edgemeal 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 03:55 AM.


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