Script Steps Reference
Table Of Contents
- Chapter 1 Introduction
- Chapter 2 Control script steps
- Chapter 3 Navigation script steps
- Chapter 4 Editing script steps
- Chapter 5 Fields script steps
- Set Field
- Set Next Serial Value
- Insert Text
- Insert Calculated Result
- Insert From Index
- Insert From Last Visited
- Insert Current Date
- Insert Current Time
- Insert Current User Name
- Insert Picture
- Insert QuickTime
- Insert Object (Windows)
- Insert File
- Update Link (Windows)
- Replace Field Contents
- Relookup Field Contents
- Export Field Contents
- Chapter 6 Records script steps
- Chapter 7 Found Sets script steps
- Chapter 8 Windows script steps
- Chapter 9 Files script steps
- Chapter 10 Accounts script steps
- Chapter 11 Spelling script steps
- Chapter 12 Open Menu Item script steps
- Chapter 13 Miscellaneous script steps
- Appendix A Glossary
28 FileMaker Script Steps Reference
By using the Get (LastError) function with the control script steps, you can make sure your
script performs correctly. When you decide to suppress alerts, it is important that you
anticipate as many problems as possible, and that you include clear directions for what to
do when an error condition is encountered.
Note Use Get (LastError) immediately after the script step you intend to test; a successful
intervening step may clear the error code you were intending to capture.
Example
Set Error Capture [On]
Perform Find [Restore]
Set Field [Table1::gErrorCaptureField; Get (LastError)]
#The field Table1::gErrorCaptureField is a global text field
If[Table1::gErrorCaptureField <> 0]
Show Custom Dialog ["Couldn't find the record..."]
End If
Set Variable
Format
Set Variable [<variable name> {[<repetition number>]};
Value:<value or formula>]
Options
Click Specify to set the variable options:
• Name is the name of the variable you want to create. Prefix the name with $ for a
local variable or $$ for a global variable. If no prefix is added, $ is automatically added
to the beginning of the name.
• Value is the value the variable is set to. You can enter text or specify a calculation.
• Repetition is the repetition (index) number of the variable you want to create. If no
repetition is specified, the default is 1.
Web compatibility
This script step is web-compatible.
Description
Sets a local or global variable to a specified value. If a variable doesn’t exist, this script
step will create one. A variable name has the same naming restrictions as a field name.
For more information, see FileMaker Pro Help.
Local and global variables can be created and used in calculations.
• A local variable can only be used in script steps in the currently executing script. The
value in a local variable is cleared when the script exits.