Jump 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.

New Windows Management

Featured Replies

In my solution I have "Help" buttons which open new windows and, hopefully, enlighten the user. My problem is that I need to locate and close any "help" windows which may still be open prior to Quitting FMP from my base window.

Edited by Guest

If you know the name(s) of your help windows, you can close them by name using the Close Window[] step.

If you wish to test for the presence of a specific window, you can use:

patterncount(¶ & windowNames & ¶; "¶Help¶")

But if you're Quitting FileMaker anyway, you don't need to explicitly close any database windows. They will close anyway when the application quits.

  • Author

I am using Auto Navigator written by David Kachel. The shutdown script makes note of the last layout and it can't be any unclosed help window. Therefore, I must locate and close all help windows before the AN shutdown script executes. I have tried a loop to close help windows by naming them all "Help"; however, the script closes my base window and fouls up the AN navigating mechanism.

I need to just pickoff the help windows prior to quitting FMP.

I can't figure out how to identify them and close them.

Try that pattercount() test with a loop and the Close Window[] step.

I know nothing about FM window management but I assume you could do something like this:

1. Create your help windows via script.

2. Have a global field dedicated to holding window names.

3. Each time you create a window add a new line to that global containing the field name.

4. Write a script that picks up the names from that global in LIFO order (last in, first out) and close them.

Apologies if this is rubbish but ...

Decided to try it:

Two scripts (I'm having trouble printing these as text):P

Script 1:

New Help Window

Set Variable [ $Next Help Window; Value:

Case (

IsEmpty ( Tests::gWindow List ); "Help 1";

"Help " & GetAsText ( GetAsNumber ( MiddleWords ( Tests::gWindow List; 2; 1) ) + 1 )

)

]

Set Field [ Test::gWindow List; $Next Help Window & "¶" & Tests::gWindow List ]

New Window [ Name: $Next Help Window ]

Script 2:

Remove Help Windows

Loop

Set Variable [ $Last Help Window; Value:LeftWords ( Tests::gWindow List; 2) ]

Close Window [ Name: $Last Help Window ]

Set Variable [ $Last Help Window; Value:$Last Help Window & "¶" ]

Set Field [ Tests::gWindow List; Substitute ( Tests::gWindow List; $Last Help Window; "") ]

Exit Loop If [ WordCount ( Tests::gWindow List ) < 1 ]

End Loop

--------------------

I hope that didn't get messed up in the copy/pasting. Indentation in the last script didn't come over.

Worked for me,

Norman

  • Author

Normanicus,

Thank you for your thoughts. The first script worked as advertised. I could indeed use it to open new windows; however, my solution will contain probably dozens of help layouts, pre-designed and available to the user.

Thus I looked closely at your second script for removing windows. I created a field to hold the help layout names and set the gWindowList to those values in a new first line of your script. I ran

the script with my debugger on and noted that for some reason the last value in the gWindowList was not set to "" and the loop was not exited.

Set Field [gWindow List; Layout Names ]

Loop

Set Variable [ $Last Help Window; Leftwords ( Tests::gWindow List; 2) ]

Close Window [ Name: #Last Help Window ]

Set Variable [ $Last Help Window; Value:$Last Help Window & "¶" ]

Set Field [ Tests::gWindow List; Substitute ( Tests::gWindow List; #Last Help Window; "") ]

Exit Loop if [ Word Count ( Tests::gWindow List < 1 ]

I don't understand the purpose of " Â " in the script. Including it caused the script to fail. When excluding it, the script didn't close and take out the last value in gWindow List.

To further complicate matters, if a user opened the same window more than once, the script , if working would only take out one copy; gWindow List by design having only one listing for each embedded help window.

I could, perhaps, some how use PatternCount to alert the user not to leave any help windows open, but not only is it inelegant, I can't take the chance the user would always comply.

I am in a quandry!

Thanks for your interest and asssistance.

George

My method should work fine.

  • Author

Ender,

Oh me of little faith! You are right it works beautifully. Happy Fourth.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.