Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7493 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted

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

This topic is 7493 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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