Just create a script named "Resume".
(It doesn't have to be named Resume. You could name it anything. You could name it "World Peace")
The script should have no script steps.
The key is that the button which calls this script has the "resume current script" option selected.
The mysterious Resume script step does exist, but is only available in layout mode, when you associate a single step to a button.
It goes like this.
You have a script which contains all you gotta do:
Pause/Resume Script (indefinitely)
You run it. Ideally on line 3 you move to a layout where there's a OK button.
That button simply does "Resume script", which will make the script from above continue with line 4.
(The "Cancel" button does an Exit Script or a Halt Script)
Drop the Pause/Resume and don't worry about Resume.
Make sure your New Window has the Modal Advanced...style and remove the ability to close it.
Then attached your script #2 to a text box that says "Submit" and your script #3 to one that says "Cancel".
In my experience resuming a script can be problematic—what happens if a user somehow navigates to the window in question without having got there by script, so there is no curet script to resume?
Another approach is to break your script in two. Script 1 is all the steps up to the opening of the modal window, at which point the script is completed. You set the window up so that the only way to close it is via a button which runs a script. This will be script 2, all the stuff you want to do after the user has entered data there. Using this approach, you might also consider adding a Cancel button, so the user can close the modal window without doing anything at all—in case that got there, say, simply out of idle curiosity.
I think this is more or less the approach suggested already by David Jondreau.
I did get it working. Once I realized the flow, and where the drop-down for button action is and how it is used. I got it working exactly how I want. I am going to try to prevent the layout from appearing any other way besides the triggering script by removing it from the list of layouts. This fortunately is a database that very few of our people ever use, and they can be taught how to use it properly. I included basic error capturing to prevent most unexpected behavior.
But, thanks to you all for the helpful comments. I don't know what I would do without the help I get on these Community boards.
BTW, how can I copy/paste script steps onto this board? Does filemaker allow that? Or do I just need to take screen shots of the Script Workspace?
the MBS plugin will let you do it easily.
Alternatively, print the script to a pdf and copy it from there. Quick and easy.
2 of 2 people found this helpful
When you associate a Script with a Button, the are hidden button options which you need.
You have to expose the additional Options by clicking the triangle. Then you will see the choice of "Halt current script, Exit current Script, Pause current script and Resume current script"