Script Steps Reference
Table Of Contents
- Contents
- Script steps reference (alphabetical list)
- About script steps
- Control script steps
- Navigation script steps
- Editing script steps
- Fields script steps
- Set Field
- Set Field By Name
- Set Next Serial Value
- Insert Text
- Insert Calculated Result
- Insert From Device
- Insert From Index
- Insert From Last Visited
- Insert From URL
- Insert Current Date
- Insert Current Time
- Insert Current User Name
- Insert Picture
- Insert Audio/Video
- Insert PDF
- Insert File
- Replace Field Contents
- Relookup Field Contents
- Export Field Contents
- Records script steps
- New Record/Request
- Duplicate Record/Request
- Delete Record/Request
- Delete Portal Row
- Delete All Records
- Open Record/Request
- Revert Record/Request
- Commit Records/Requests
- Copy Record/Request
- Copy All Records/Requests
- Import Records
- Export Records
- Save Records As Excel
- Save Records As PDF
- Save Records As Snapshot Link
- Found Sets script steps
- Windows script steps
- Files script steps
- Accounts script steps
- Spelling script steps
- Open Menu Item script steps
- Miscellaneous script steps
- Get Directory
- Show Custom Dialog
- Allow Formatting Bar
- Refresh Object
- Beep
- Speak (OS X)
- Dial Phone
- Install Plug-In File
- Install Menu Set
- Set Web Viewer
- Open URL
- Send Mail
- AVPlayer Play
- AVPlayer Set Playback State
- AVPlayer Set Options
- Refresh Portal
- Send DDE Execute (Windows)
- Perform AppleScript (OS X)
- Execute SQL
- Send Event
- Comment
- Flush Cache to Disk
- Exit Application
- Enable Touch Keyboard
- Glossary
Control script steps
F
ILEMAKER SCRIPT STEPS REFERENCE 23
If
Purpose
Evaluates a Boolean calculation and performs a conditional action based on that evaluation.
Format
If [<Boolean calculation>]
Options
<Boolean calculation> specifies the calculation you want evaluated.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If the calculation result is any number except zero, the calculation evaluates to true and the
subsequent script steps are executed. If the calculation result is zero, no data, or does not resolve
into a number, then the calculation evaluates to false and the subsequent script steps are not
executed.
Every If step must have a corresponding End If script step somewhere after the If step and at the
same indentation. Whenever you use an If script step, the script editing pane automatically enters
an End If step.
You can also add additional conditions by using the Else If script step and Else script step.
Note If you do not specify a calculation or if the calculation is unsuccessful, it will evaluate as false.
Use the Get(LastError) function to capture these errors.
Example 1
Performs a find. If no records are found, displays all records and sorts.
Perform Find [Restore]
If [Get (FoundCount) = 0]
Show All Records
Sort Records [Restore; No dialog]
End If
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 Yes