Perform Script
Purpose 
Performs a script that is defined in the current file or in another FileMaker Pro file.
Format 
Perform Script [“<script name>; Parameter: <parameter>]
Options 
To select a script, click Specify and choose the script from the list.
For Optional script parameter, type the text you want to use or click Edit and use the Specify Calculation dialog box to build a more complex parameter.
Compatibility 
 
Where the script step runs 
Supported 
FileMaker Pro 
Yes 
FileMaker Server scheduled script 
Yes 
FileMaker Go 
Yes 
Custom Web Publishing 
Yes 
FileMaker WebDirect 
Yes 
Runtime solution 
Partial 
Originated in 
FileMaker Pro 6.0 or earlier
Description 
There is no need to open an external file when using a script in it—FileMaker Pro opens it for you.
You can use separate scripts to break complex tasks into smaller segments, which are often easier to troubleshoot. You can also save time by putting common tasks like printing or exporting records into separate scripts, which can then be accessed by more than one script. For example, you might want to use the same page setup and printing options in several scripts. By defining those steps once and saving them in separate scripts, you make it easy to access those steps many times.
Use script parameters to pass text or numbers into a script. When a parameter is specified, that parameter may be accessed within a script or passed to other script steps using the Get(ScriptParameter) function.
Script parameters:
 •
exist within the parent script only unless explicitly passed to the sub-script. If your script calls another script, parameters in the called script are independent of parameters in the parent script.
 •
 •
 •
Tip  If you've performed an external script and you want to return to the original file, add an Enter Browse Mode step or Go to Layout step right after the Perform Script step in the original file, so that the script returns to the original file.
Notes
 •
 •
Example 1 
Runs the "Print Invoice Report" script with no parameters.
Go to Layout ["Invoice Report"]
Perform Script ["Print Invoice Report"]
Example 2 
Uses a field value, Customer Name, as the parameter. Invoices for the current customer are returned in a new window with the Invoice Report layout.
Main script: Current Customer Invoices
Find Matching Records [Replace; Invoices::Customer ID]
#Calls the "View Customer Invoices" sub-script defined below
Perform Script ["View Customer Invoices"; Parameter: Invoices::Customer Name]
Sub-script: View Customer Invoices
New Window [Name: "Customer: " & Get ( ScriptParameter ); Style: Document]
Go to Layout ["Invoice Report"]
Sort Records [Restore; No dialog]
Related topics 
Perform Script and script parameter examples
Script steps reference (alphabetical list)
Script steps reference (category list)
Defining custom menus (FileMaker Pro Advanced)
About formulas