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:

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:

option value

Description

0

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 option is not specified. This is also the default behavior for FileMaker.PerformScript().)

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 script is run.

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 script is run.

3

Resume

A paused FileMaker script is resumed. After the resumed script is completed, script is run.

4

Pause

A paused FileMaker script remains paused. If the paused script is resumed and completed, then script is run.

5

Suspend and Resume

A currently running FileMaker script is suspended and script is run. When script is completed, the suspended script resumes with the next script step. A paused script remains paused while script is run.

Important  Use the Suspend and Resume option with caution. Because script can change the current context (for example, go to a different layout, modify records, and change global variables), the suspended script could resume in a different context and produce unexpected results.