What does your script actually do?
If you end this script with Exit Script [false] it cancels out the focus change brought about by the field exit, but can't tell you if this is a good idea or not as I don't know what your script is supposed to do.
I'm using the script to implement a filtered portal functionality (I'm in FM 10). It's basically:
Go To Layout[Contacts]
Enter Find Mode
Go To Layout[Original Layout]
As mentioned, the script is triggered by exiting gFilterText. The problem essentially is that if I hit Return from gFilterText to trigger the script, FM seems to wait until the script is entirely finished and exited before it applies the Go To Next Object command.
And what problem does that cause?
None of your script steps rely on the current layout focus so this should not affect how this script executes.
Your script as posted is missing some key details, namely table occurence names in the set variable steps and it would help to know on what table occurrence your layout is based where this script starts its executiong.
Also, this step is missing a parameter:
I don't know how many of these are omissions in the actual script and how many were just left out of your post.
To post a script to the forum:
- You can upload a screen shot of your script
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
- If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional look to your script. (Use the HTML option and paste the text into the HTML editor.)
The problem that it causes is that I want the field focus to not go to whatever field or object is next in the tab order. It's strictly an end user functionality detail. I want either no focus or for the focus to be placed back upon the original field.
I'll keep the script posting comments in mind, my actual script is a good bit longer and less intuitive to understand than the above simplified version, in this instance I don't think it would make diagnosis easier. Also, the issue at hand really has less to do with the script itself and more with what seems like a behavior of FM, which I'm wondering if there's a work around for.
Then End your script with Exit Script [False] as I previously suggested.
This cancels out the original triggering event (go to next object here) and will leave the cursor in the current field.
I thought I did try Exit Script, but I'll give it another shot when I'm back in on Friday. Thanks.