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.
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.
Hi Fred - I should have mentioned that the solutions I'm working with are just single file solutions.
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.
OnLastWindowClose Demo.fmp12.zip 383.3 K
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.