For example, let's say we have a FMPa v13 file called "Sample_FMP_DB.fmp12". Let's further assume the original Layout is called "Master Layout" and the new dialog-ish Layout is called "Small Layout". The script starts when a button is clicked on the "Master Layout" screen, and invokes the New Window function bringing up the "Small Layout". This of course resizes the "Master Layout" screen. When using the Move/Resize Window function, what do I put in for the Window Name to bring back the full sized "Master Layout" screen?
It doesn't really matter what any layout is called (or the file, for that matter); it's the window name that counts.
If you use Get ( WindowName ), do it before you open the “dialog” window, then use its result, as in:
Set Variable [ $windowToResize ; Get ( WindowName ) ]
New Window [ dialogWindow ]
Move/Resize Window [ Window to resize: $windowToResize ; … ]
In my oppinion it's best to keep control over the window names and default size. In my start-script I usually do this:
Set Window Title [ Current Window; New Title: "1" ] //this renames the initial window on open
do some stuff here for example hide statusbar.....
New Window [ Name: "myIntendedWindowName"; Height: If ( GUI::Platform = 1 ; 912 ; 934 ); Width: If ( GUI::Platform = 1 ; 1401 ; 1422 ); Top: 1; Left: 1; Style: Document; Close: “No”; Minimize: “No”; Maximize: “No”; Zoom Control Area: “No”; Resize: “Yes” ] //I lock down the minimize/maximize/close-buttons and implement my own....
Close Window [ Name: "1"; Current file ] //close the initial window
now I know the window name and I lock down the "New Window" menu-command, so I can control new windows and it's names...
I use similar setups. I just do for example :
Open New Window name : DialogX (I set the dimensions with calculation)
Enter Find Mode (to avoid script triggers)
Goto Dialog Layout
Enter Browse Mode
(if needed a resize could be done)
Close Window name DialogX.
FileMaker names the first window it opens the same as the database name. But any new windows you can name anything you want.
How about using popup button instead of new window?
Thanks for all the great suggestions! Appreciate it.
if You have the second window as an 'utility' (no need to deactivate all the options) window, You can just close it after action was taken - the original window will be on top again.
As mentioned in other answers, You can get the 'master window name' before creating a new window an You got the name for going back.
I usually do an 'activate window (desired_name)' before the 'new window(desired_name)'. If the last error is (window exists), I close that window - helps to keep the screen clean..