Old 10-14-2019, 07:39 PM   #1
Gerry P
Human being with feelings
 
Gerry P's Avatar
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 1,428
Default How to close Console window automatically

I want to toggle FX enable within an action.

I found the SWS action "SWS: Open console with 'f' to toggle FX enable".

However, I can't find a way to close the console window immedately after this instruction to move to the next step.

I tried to use Edgemeal's post https://forum.cockos.com/showpost.ph...11&postcount=2 without any luck.

Can anyone help?
__________________
The future ain't what it used to be. Yogi Berra
Gerry P is offline   Reply With Quote
Old 10-14-2019, 07:57 PM   #2
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,435
Default

You'd need to change the title text to 'ReaConsole', e.g.,.

Code:
function CloseReaConsole()
  local title = reaper.JS_Localize('ReaConsole', "common")
  local hwnd = reaper.JS_Window_Find(title, true)
  if hwnd then reaper.JS_Window_Destroy(hwnd) end  
end

Last edited by Edgemeal; 10-14-2019 at 08:23 PM.
Edgemeal is offline   Reply With Quote
Old 10-14-2019, 08:16 PM   #3
Gerry P
Human being with feelings
 
Gerry P's Avatar
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 1,428
Default

Thanks Edgemeal for such a quick reply.

I tried your suggestion and although it did close the Console Window, a ReaScript console output window opened instead, which then has to be closed. (I may be missing something though).
__________________
The future ain't what it used to be. Yogi Berra
Gerry P is offline   Reply With Quote
Old 10-14-2019, 08:27 PM   #4
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,435
Default

That code closes a window, not opens them! Check you code!

On another note, the code above was using 'reaper.JS_Window_FindTop', and that wouldn't work if the window was docked so I changed it to 'reaper.JS_Window_Find'.
Edgemeal is offline   Reply With Quote
Old 10-14-2019, 08:58 PM   #5
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,347
Default

The original example does show a console message if the wait time hasn't been reached yet. Just remove the line with reaper.ShowConsoleMsg.
Lokasenna is offline   Reply With Quote
Old 10-15-2019, 08:42 AM   #6
Gerry P
Human being with feelings
 
Gerry P's Avatar
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 1,428
Default

Quote:
Originally Posted by Lokasenna View Post
Just remove the line with reaper.ShowConsoleMsg.

Thanks... that did it.
__________________
The future ain't what it used to be. Yogi Berra
Gerry P is offline   Reply With Quote
Old 10-15-2019, 08:51 AM   #7
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,435
Default

Quote:
Originally Posted by Gerry P View Post
Thanks... that did it.
Sorry I missed that.
Edgemeal is offline   Reply With Quote
Old 10-16-2019, 06:39 PM   #8
Gerry P
Human being with feelings
 
Gerry P's Avatar
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 1,428
Default

np... I'm just happy you had written this script. Thanks again.
__________________
The future ain't what it used to be. Yogi Berra
Gerry P is offline   Reply With Quote
Old 10-16-2019, 07:17 PM   #9
Gerry P
Human being with feelings
 
Gerry P's Avatar
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 1,428
Default

I am trying complete a custom action that will toggle the selected track's FX enabled using SWS: Open console with 'f' to toggle FX enable but if I follow with the CloseConsole(), the SWS command does not complete.

Prior to running CloseConsole(), how can I send an ENTER key command to accept whatever is in the Console window.

Although I briefly searched the .lua manual, it is a little overwhelming.
__________________
The future ain't what it used to be. Yogi Berra
Gerry P is offline   Reply With Quote
Old 10-16-2019, 08:41 PM   #10
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,435
Default

Quote:
Originally Posted by Gerry P View Post
I am trying complete a custom action


I found this in the API docs, seems to do the same thing that sws console thing is doing here,..

Code:
-- (-1) = bypass all if not all bypassed,otherwise unbypass all.
reaper.BypassFxAllTracks(-1)
EDIT
Although there are these actions,
Code:
Track: Bypass FX on all tracks
Track: Unbypass FX on all tracks
So now I'm not sure what you need, I don't even know what SWS console is, maybe it does more?.. never used it LOL!
Edgemeal is offline   Reply With Quote
Old 10-18-2019, 11:55 AM   #11
Gerry P
Human being with feelings
 
Gerry P's Avatar
 
Join Date: Jan 2009
Location: Ontario, Canada
Posts: 1,428
Default

Thanks for the reply.

In the end, I was able to finish my Custom Action using only the Reaper and SWS commands without the need to open the Console window - and therefore no need to close it.

My goal, among others in my Custom Action, was to toggle FX Enable on selected tracks only.
__________________
The future ain't what it used to be. Yogi Berra
Gerry P 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 05:58 AM.


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