Help

Table Of Contents
Creating scripts to automate tasks
F
ILEMAKER PRO HELP 445
Set Field [Customers::Day Contact; Customers::Work Phone]
Go to Record/Request/Page [Next; Exit after last]
End Loop
Example 2
Loops through records to export files that are in container fields. Exits the loop if a record has an
empty Container field.
Set Variable [$PATH; Value: Get ( DocumentsPath ) & Products::Container]
Go to Record/Request/Page [First]
Loop
Exit Loop If [IsEmpty ( Products::Container )]
Export Field Contents [Products::Container; "$PATH"]
Go to Record/Request/Page [Next; Exit after last]
End Loop
Startup script examples
A startup script can customize a user's view of a database or perform other actions when a
database opens. Startup scripts are triggered by the OnFirstWindowOpen script trigger. For
information on setting up a startup script, see Setting file options.
Example 1
Goes to the Administration layout if the account is assigned the Full Access privilege set. Otherwise,
goes to the Data Entry layout.
If [Get ( AccountPrivilegeSetName ) = "[Full Access]"]
Go to Layout ["Administration"]
Else
Go to Layout ["Data Entry"]
End If
Example 2
Checks which version of FileMaker Pro or FileMaker Go opened the database and goes to the
appropriate Customers layout.
If [Get ( Device ) = 3]
Go to Layout ["Customers iPad"]
Else If [Get ( Device ) = 4]
Go to Layout ["Customers iPhone"]
Else
Go to Layout ["Customers"]
End If
Perform Script and script parameter examples
Perform Script performs a script that is defined in the current file or in another FileMaker Pro file.
Optional script parameters can pass text into a script. For example, you can use a script parameter
to store the active record number when a script is initiated, making it easy to return to that record at
the end of the script. Or you can call the same script from different buttons on the same layout, and
easily determine which button called the script by using a different script parameter for each button.