Help

Table Of Contents
Creating scripts to automate tasks
F
ILEMAKER PRO HELP 446
When you specify a parameter, you can access it within a script or pass it to other scripts using the
Get(ScriptParameter) function.
Complex parameters, such as a list of names or other values, can also be used. Complex
parameters that are separated by carriage returns can be parsed using the
LeftValues function,
MiddleValues function, and RightValues function. These functions return the beginning, middle, and
ending values from lists that are separated by carriage returns. Complex parameters separated by
other characters can be parsed as text using functions such as
Left function, Middle function, and
Right function.
Notes
A script parameter exists only for the duration of the script. Script parameters are reset each
time a script is performed. If you want a script parameter to persist while a file is open, you
can use a global
variable as the script parameter.
A script parameter exists within the parent script only, unless it is explicitly passed to
another script using the Get(ScriptParameter) function.
A script parameter can be used (but not modified) within a script and can be passed along
to sub-scripts by using the Get(ScriptParameter) function as the parameter for the sub-
script. You can also specify different parameters each time the sub-script is called using
Perform Script. Changing the parameters passed to a sub-script does not modify the value
of the parameters returned from Get(ScriptParameter) in the parent script.
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, 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]