Windows Management Part I: Cleaning up Windows in FileMaker

Posted on November 20, 2011

0


 

I was working on a database that linked a lot of data to other data, employing many join tables. It is a database about maintaining a library of video and audio recordings of art events. The idea is to allow researchers explore and move through Artists, Events, Media Assets, Groups and Programs easily. As a result, I decided to build it so that it opens window after window. The user can jump from an Artist to an Event, or Group. After a while the screen can get cluttered, so I wanted an easy way to clean up the screen and get the user back to basics.

A Google search brought me to this thread on FMForums on how to get the count of open windows in FileMaker. Here is a demo file of how I wrote the script in my database.

Demo File – Open a Bunch of Windows

media_1321819173549.png

1) Enter the number of windows you want to mess up your screen with.
2) Click the “Open a Bunch of Windows” button.

Too many windows

media_1321818293037.png

The screen will be populated with windows.

Click the “Clean Up Windows” button to return to a single window.

media_1321819207864.png

The key to the script is:

ValueCount(WindowNames(Get(FileName))

This function gives you a count of open windows. From there, I wrapped it in a loop that Closes all Windows, but that is set to halt if there is only a single window left on screen. If you have only one window to start with, the script halts before it gets going.

 

Advertisement
Posted in: Techniques