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.

Best way to check if a window is already open?

Featured Replies

I've seen a few discussions on window management in FMP7, but haven't found an answer to this question:

What is the best way to check if a window is already open, so that you don't open another just like it?

The best I can figure is to create a loop to parse WindowNames with LeftValues, in conjunction with an If / Else / End if section. Is there a more simple way to do this?

Thanks

Chris

  • Author

Yes, that is a great thread and several times it mentions "check to see if a window is open", but never specifically states how.

I've almost got the script I mention above to work but it seems overly complex for what it does. I'm just wondering if there is a more simple way to do it -- something I'm overlooking.

Thanks

I'm sure I read more about this somewhere. This was the general idea:

If you use a consistent naming scheme for your windows, like: "MyTable: LayoutName", then when adding a new window you can check if there is already an instance of a window before creating a new one.

If [ PatternCount(WindowNames, "MyTable") //go into more datail if needed. ]

#Window already exists.

Else

#Create New Window

End If

You may have to rename windows in navigation scripts to make everything work out.

  • Author

Aha! PatternCount was the missing piece.

I knew there was something simpler than using LeftValues and loop counter based on the number of open windows. I'll post the whole script here when I've got it working.

The more I learn the more I see how much there is left to learn.

Thank you!

Chris

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.