Pop up windows can be a useful feature of any Filemaker database. Though best used sparingly, they can be employed in a multitude of different ways, for example; as a splash screen at login, during scripted processes to control user input, as picker selection screens, as mini information screens providing user instructions, etc.
Create a pop up window using the New Window* script step, usually followed by Go To Layout then Adjust Window (specify Resize To Fit).
The Move/ Resize Window script step can place pop up windows at a precise spot on the user’s desktop. Instead of specifying exact positions in the Distance From Top and Distance From Left parameters of this script step, you can use calculations to make the placement of the window dynamic, responding to the current context of the user’s desktop.
A few extra script steps can position pop up windows relative to the main database window’s current position on the user’s desktop. Wherever the main window moves, your pop up windows can be “smart” and follow suit!
The unlocked sample file attached to this article contains a script showing how to create smart pop windows. Variables are used to store a range of window measurements; Get(WindowHeight), Get(WindowWidth), Get(WindowTop) and Get(WindowLeft). The values stored in these variables are used to perform calculations inside the Move/ Resize Window script step. The end result is that the pop up window is positioned in the centre of the main database window, regardless of its position on the user’s desktop. This works every time, regardless of the pop up window’s dimensions.
You can play around with the variable values and/ or the calculations in the Move/ Resize Window script step to further adjust the placement of the pop up window, as required.
*The New Window script step creates a carbon copy of the current window. If you have an active Install OnTimer Script working on the current window, the new window will inherit it! Remember to deactivate it to avoid unexpected results!