Options for handling the current script when starting new scripts
Normally, only one script can run at a time, and additional calls to run scripts are queued until the running script is completed. However, the following ways of starting a new script can affect the currently running script:
-
The user clicks a button that is defined to run a script. You can choose one of the options to pause, resume, exit, or halt the running script as described in Defining or changing a button.
-
JavaScript in a web viewer calls a FileMaker script using the FileMaker.PerformScriptWithOption() function. See Scripting with JavaScript in web viewers.
-
An fmp URL specifies a script to run. See Opening files using a URL.
In the FileMaker.PerformScriptWithOption() function and in fmp URLs, the option
parameter controls how a currently running FileMaker script is handled when a script
is called. For option
values from 0 to 4, the call to run the specified script is queued and may not start immediately. option
can have one of the following string values:
|
Description |
|
Continue After a currently running FileMaker script has completed, queued FileMaker scripts are run in order. If FileMaker script execution is canceled, the queue is cleared. (This is the behavior if |
1
|
Halt Execution of a currently running FileMaker script is halted, and all other pending scripts (queued or in the call stack) are canceled. Then |
2
|
Exit A currently paused FileMaker script is exited. If the current FileMaker script was called by another FileMaker script, control returns to the calling FileMaker script until no more scripts remain in the call stack. Then |
3
|
Resume A paused FileMaker script is resumed. After the resumed script is completed, |
4
|
Pause A paused FileMaker script remains paused. If the paused script is resumed and completed, then |
5
|
Suspend and Resume A currently running FileMaker script is suspended and Important Use the Suspend and Resume option with caution. Because |