Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Selecting Windows

Featured Replies

I always end up with too many open windows and would like to write a script which would close all but the same two windows.

I have been trying to use the window names returned by the windownames function as variable to do a loop which would close one window after the other except the two I want open. I can't figure out how to assign the result of the windownames function as a variable.

The variable should then be assigned to the SelectWindow function.

Thanks for any help

yknot

Try this, it's a bit messy but...

Allow User Abort[off]

Set Error Capture[on]

Freeze Window

SetVariable[ $n ; 2 ]

SetVariable[ $windows ; Substitute( ¶ & WindowNames & ¶ ; ["¶The Window You want kept open here¶" ; ¶ ] ; ["¶The Second Window You want kept open here¶" ; ¶]) ]

Loop

Exit Loop If[ $n > valueCount($windows) ]

Select Window[ Name: GetValue( $windows ; $n ) ; CurrentFile ]

If[ Get(LastError) = 0 ]

Close Window

End If

SetVariable[ $n ; $n + 1 ]

End Loop

Edited by Guest

  • Author

Tnx for the quick reply. Have not had a chance to write the script yet but would much appreciate a bit of explanation of this line:

SetVariable[ $windows ; Substitute( ¶ & WindowNames & ¶ ; ["¶The Window You want kept open here¶" ; ¶ ] ; ["¶The Second Window You want kept open here¶" ; ¶]) ]

yknot

SetVariable[ $windows ; Substitute( ¶ & WindowNames & ¶ ; ["¶The Window You want kept open here¶" ; ¶ ] ; ["¶The Second Window You want kept open here¶" ; ¶]) ]

Your don't want to close two particular windows so we're eliminating them from the list of windows to close.

A bit different approach I've used, in a script:

Loop

Exit Loop If [ ValueCount ( WindowNames ( Get ( FileName ) ) ) = 1 ]

Close Window [ Current Window ]

End Loop

Go to Layout [ “MyHome” ]

Set Window Title [ Current Window; New Title: Get ( LayoutName ) ]

But that just closes every window except for one... And then sets it to a default location, i suppose it might be suitable but...

I find it easier to clean up after myself after each layout/window switch. If this isn't tracked, you can run into 1) record lock issues and 2) system running out of resources and freezing up. You can use the same windows ... just perform layout switches. You can even rename your windows to the other window you are replacing/closing, thus switching horses mid-stream. You can test if a window is open and just bring it to the front if so; as compared to always opening a new one.

So the best defense is a good offense - consider tracking them to begin with. :wink2:

LaRetta

Lol, or just don't use them :P I build single window solutions.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.