- If you have a modal window open, and you run a script that tries to select the parent window, the script step should fail, but it doesn't in Pro 16.
Yes, I realize that this is a contrived scenario that you wouldn't ever do "in real life", but long story short, I encountered something similar to this with one of my clients in a solution developed by someone else. The point is that the Select Window step seems to be misbehaving, and this scenario is an effective way to demonstrate that.
How to recreate (see attached demo file):
- Click button to open a modal window.
- Click button to run a script from that window.
- The script tries to select the parent window (i.e. the original window which is behind the modal window). It will fail (as expected), because the current window is a modal window, and because you're not allowed to select another window while the modal window is still open. The script step correctly shows error code 3. So far, so good.
- After this script step runs, the current window should still be the modal window, and it appears to be, because the modal window is still shown on top. But it seems that the current window was actually switched to the parent window (even though the previous step resulted in error code 3). You can see this by checking Get(WindowName). You could also, for instance, modify the script to do a Go to Layout step, and you'll see that it will switch the layout for the parent window, not the modal window.
If you do this in 15, it works as you would expect, so this seems to be a 16-only bug.
Product and version: FileMaker Pro Advanced 220.127.116.112
OS and version: Observed on both a mac (10.12.6) and a Windows machine.