Exit Script
Purpose 
Forces sub-scripts or external scripts to stop immediately and return to the main script, with or without an optional script result.
Format 
Exit Script [Result: <value or formula>]
Options 
Click Specify to specify a value in the Specify Calculation dialog box. The value is typically based on the state of the current script. The value is passed back to the calling script, where it can control the script’s logic.
Compatibility 
 
Where the script step runs 
Supported 
FileMaker Pro 
Yes 
FileMaker Server scheduled script 
Yes 
FileMaker Go 
Yes 
Custom Web Publishing 
Yes 
Instant Web Publishing 
Yes 
Runtime solution 
Yes 
Originated in 
FileMaker Pro 6.0 or earlier
Description 
If the optional script result is specified, the script result is returned and stored in the main script until another sub-script that returns a value is called. The script result gets deleted when you exit the main script. The script result can be stored in a local or global variable for later use.
Examples 
#Example 1: Master Mailing Label Script
Go to Layout ["Mailing Labels"]
Perform Script ["Find records for California mailing"]
Go to Layout ["List View"]
#Find records for California mailing sub-script
Perform Find [Restore]
If [Get (ScriptResult)=0]
Show All Records
Go to Layout ["Data Entry"]
Exit Script
Else
Print []
End If
#Example 2: Assign Letter Grade
If [Get(ScriptParameter) >= 90]
Exit Script[Result: "A")]
Else If [Get(ScriptParameter) >= 80]
Exit Script[Result: "B"]
Else If [Get(ScriptParameter) >= 70]
Exit Script[Result: "C"]
Else If [Get(ScriptParameter) >= 60]
Exit Script[Result: "D"]
Else
Exit Script[Result: "F"]
End If
Related topics 
Script steps reference (alphabetical list)
Script steps reference (category list)
About formulas