Script launches in another window than the one where button has been clicked
Operating system version
Mac OS X 10.6.3
Description of the issue
When I have multiple windows of the same database open, sometimes (often) after switching from another application to FileMaker Pro using Command-Tab, when I click a button, FileMaker first brings another window (with a different context) to front and THEN launches the script the button is hooked to. As a result the script runs from a wrong context!
Steps to reproduce the problem
I have not found reliable set of steps to reproduce this every time. So, what has just happened to me (in exact order - 100% sure):
1) Had 3 windows of our database open (let's name them "window 1", "window 2", and "window 3" in the order they were opened)
2) Switched to Safari (to a different space) using Command-Tab
3) Switched back to FileMaker using Command-Tab
4) Clicked button in the frontmost window (let's call it window 3)
5) FileMaker brought another window to front (let's call it window 1)
6) FileMaker launched the script attached to the button I clicked
The above step 5 should not happen
Often (but not always) the step 5 happens
In summary, button was clicked in window 3 but the script was launched in window 1. So FileMaker switched the window after processing the mouse click but before launching the script.
Exact text of any error message(s) that appear
Whatever errors related to running script with a wrong context
I am using the latest build of FMPA 11v2 (used the update that's publicly available on FMI's website) on Mac OS X 10.6.3. I have not yet updated to 10.6.4 due to it's compatibility issue with 10.5 calendar server, so it is possible that this may be a correlation of a bug in FM and another bug in Mac OS X.
Have not found reliable workaround yet, although some may exist.