5 Replies Latest reply on Sep 3, 2015 8:42 AM by TSGal

    OnLastWindowClose not firing when closing file with multiple windows open

    databuzz

      I've noticed when opening a solution in FileMaker Pro 14.0.2 on Mac OS X 10.10.5 that when closing a file that has multiple windows open the OnLastWindowClose script trigger doesn't always fire.

       

      I have a OnLastWindowClose trigger that performs a simple script that navigates to a home layout and positions the window in the top left corner. This has worked reliably for v12 and v13, but with v14 if I have more than one window for the file open and close all windows the OnLastWindowClose trigger doesn't always fire. I can tell this is the case as the file opens to the last window and is not positioned in the top left corner of the screen.

       

      I also have a OnFirstWindowOpen trigger which also doesn't appear to fire in this situation, i.e. when I open the file after having multiple windows open and the OnLastWindowClose doesn't fire the OnFirstWindowOpen also doesn't fire when opening the file again.

        • 1. Re: OnLastWindowClose not firing when closing file with multiple windows open
          TSGal

          databuzz:

           

          Thank you for your post.

           

          I'll need more information to try and replicate this issue.  Specifically, is the original window the last window closed?  Or, are one of the secondary windows the last window to close?

           

          If you pull down the Window menu and select "Show Window", is the original window or a secondary window listed/hidden?  This would also account for a OnFirstWindowOpen trigger not firing if a secondary file is already open.

           

          Any other information you can provide may be helpful in replicating this issue.

           

          TSGal
          FileMaker, Inc.

          • 2. Re: OnLastWindowClose not firing when closing file with multiple windows open
            Fred(CH)

            As a "food for brain," here is an issue i reported previously about OnFirstWindowOpen.

             

            In essence, in a multi-file solution, when a file "B" is opened "hidden" by performing one of its script from File "A", this external subscript is executed, without firing OnFirstWindowOpen and this for understandable reasons. All Fine. However, if afterwards the enduser is opening file "B" manually or by a button, OnFirstWindowOpen is still not fired with a lot of unexpected result.

             

            Not sure if it could be applicable for OnLastWindowClose.

             

            Fred

            • 3. Re: OnLastWindowClose not firing when closing file with multiple windows open
              databuzz

              Hi Fred - I should have mentioned that the solutions I'm working with are just single file solutions.

              • 4. Re: OnLastWindowClose not firing when closing file with multiple windows open
                databuzz

                I've just spent 15 minutes running some tests and I was able to reproduce this consistently with one of my solutions files. I would do the following:

                 

                1. open solution file (single file)

                2. navigate around, e.g. from list to form layout etc.

                3. create a new window and then navigate around in that 2nd window

                4. at this point there are only 2 windows open, both are visible

                5. close window2 and window1 in quick succession via keyboard Command W shortcut

                6. solution is now closed

                7. open solution again and it opens at window2

                 

                If I run the same tests with the Script Debugger on the script triggers for opening and close the file are performed as expected.

                 

                If I close window1 first then close window2 some seconds later the script triggers perform as expected. I've created a simple copy of the Contacts Starter solution that you can use to replicate this yourself - I've attached it to this post. If you open this then navigate to a different layout, create a new window and navigate to another layout then close both windows in quick succession via the keyboard and then open the file again you should find it will not be on the 'home' layout. You might have to run this test a few times to see this in action.

                • 5. Re: OnLastWindowClose not firing when closing file with multiple windows open
                  TSGal

                  databuzz:

                   

                  Using your demo file, I am still unable to replicate the issue with FileMaker Pro Advanced 14.0.2 on my iMac running Mac OS X 10.10.5.  No matter which layout I go to, where I place my windows, which window I close first, closing in quick succession using Command-W, etc., I still get the file to open in Position 0,0 and display the "Contact Details" layout.

                   

                  Let me know if there are specific layouts or other steps you want me to try.

                   

                  Do you have any plug-ins installed?  If so, temporarily disable them and see if you can replicate the issue.

                   

                  TSGal

                  FileMaker, Inc.