Filemaker Pro 15 Script Steps Reference File Maker Fmp15 Scripts Ref

User Manual: filemaker FileMaker Pro 15 - Script Steps Reference Free User Guide for FileMaker Software, Manual

Open the PDF directly: View PDF PDF.
Page Count: 306 [warning: Documents this large are best viewed by clicking the View PDF Link!]

FileMaker® Pro 15
Script Steps Reference
© 2007–2016 FileMaker, Inc. All Rights Reserved.
FileMaker, Inc.
5201 Patrick Henry Drive
Santa Clara, California 95054
FileMaker and FileMaker Go are trademarks of FileMaker, Inc. registered in the U.S. and other countries. The file folder logo
and FileMaker WebDirect are trademarks of FileMaker, Inc. All other trademarks are the property of their respective owners.
FileMaker documentation is copyrighted. You are not authorized to make additional copies or distribute this documentation
without written permission from FileMaker. You may use this documentation solely with a valid licensed copy of FileMaker
software.
All persons, companies, email addresses, and URLs listed in the examples are purely fictitious and any resemblance to
existing persons, companies, email addresses, or URLs is purely coincidental. Credits are listed in the Acknowledgments
documents provided with this software. Mention of third-party products and URLs is for informational purposes only and
constitutes neither an endorsement nor a recommendation. FileMaker, Inc. assumes no responsibility with regard to the
performance of these products.
For more information, visit our website at http://www.filemaker.com.
Edition: 01
Contents
FILEMAKER PRO SCRIPT STEPS REFERENCE 3
Contents
Script steps reference (alphabetical list) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
About script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Creating scripts to automate tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Using this script steps reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Learning about scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Control script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Perform Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Perform Script On Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Pause/Resume Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Exit Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Halt Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Else If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
End If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Exit Loop If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
End Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Allow User Abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Set Error Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Set Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Set Layout Object Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Install OnTimer Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Navigation script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Go to Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Go to Record/Request/Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Go to Related Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Go to Portal Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Go to Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Go to Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Go to Next Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Go to Previous Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Close Popover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Enter Browse Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Enter Find Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Enter Preview Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Editing script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Undo/Redo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Cut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Set Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Select All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Perform Find/Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Contents
FILEMAKER PRO SCRIPT STEPS REFERENCE 4
Fields script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Set Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Set Field By Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Set Next Serial Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Insert Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Insert Calculated Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Insert From Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Insert From Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Insert From Last Visited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Insert From URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Insert Current Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Insert Current Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Insert Current User Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Insert Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Insert Audio/Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Insert PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Insert File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Replace Field Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Relookup Field Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Export Field Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Records script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
New Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Duplicate Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Delete Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Delete Portal Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Delete All Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Open Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Revert Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Commit Records/Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Copy Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Copy All Records/Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Import Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Export Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Save Records As Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Save Records As PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Save Records As Snapshot Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Truncate Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Found Sets script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Perform Find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Perform Quick Find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Constrain Found Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Extend Found Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Modify Last Find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Show All Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Show Omitted Only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Omit Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Omit Multiple Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Sort Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Sort Records by Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Unsort Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Find Matching Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Contents
FILEMAKER PRO SCRIPT STEPS REFERENCE 5
Windows script steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
New Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Select Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Close Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Adjust Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Move/Resize Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Arrange All Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Freeze Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Refresh Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Scroll Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Show/Hide Menubar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Show/Hide Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Show/Hide Text Ruler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Set Allowed Orientations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Set Window Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Set Zoom Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
View As . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Files script steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
New File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Open File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Close File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Convert File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Set Multi-User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Set Use System Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Save a Copy as . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Recover File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Print Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Accounts script steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Add Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Delete Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Reset Account Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Change Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Enable Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Re-Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Spelling script steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Check Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Check Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Check Found Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Correct Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Spelling Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Select Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Edit User Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Open Menu Item script steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Open Edit Saved Finds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Open Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Open File Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Open Manage Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Open Manage Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Contents
FILEMAKER PRO SCRIPT STEPS REFERENCE 6
Open Manage Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229
Open Manage Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Open Script Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Open Manage Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Open Manage Value Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Open Find/Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Open Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Open Remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Open Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Upload To FileMaker Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Miscellaneous script steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Show Custom Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Allow Formatting Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Refresh Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Beep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Speak (OS X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Dial Phone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Install Plug-In File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Install Menu Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Set Web Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Open URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Send Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
AVPlayer Play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
AVPlayer Set Playback State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
AVPlayer Set Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Refresh Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Send DDE Execute (Windows) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Perform AppleScript (OS X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Execute SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Send Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Comment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Flush Cache to Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Exit Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Get Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Enable Touch Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Script steps reference (alphabetical list)
FILEMAKER PRO SCRIPT STEPS REFERENCE 7
Script steps reference (alphabetical list)
Add Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Adjust Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Allow Formatting Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Allow User Abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Arrange All Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
AVPlayer Play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
AVPlayer Set Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
AVPlayer Set Playback State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Beep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Change Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Check Found Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Check Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Check Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Close File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Close Popover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Close Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Comment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Commit Records/Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Constrain Found Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Convert File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Copy All Records/Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Copy Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Correct Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Cut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Delete Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Delete All Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Delete Portal Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Delete Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Dial Phone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Duplicate Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Edit User Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Else If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Enable Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Enable Touch Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
End If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
End Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Enter Browse Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Enter Find Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Enter Preview Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Execute SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Exit Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Exit Loop If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Exit Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Export Field Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Export Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Extend Found Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Find Matching Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Flush Cache to Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Script steps reference (alphabetical list)
FILEMAKER PRO SCRIPT STEPS REFERENCE 8
Freeze Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Get Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Go to Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Go to Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Go to Next Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Go to Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Go to Portal Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Go to Previous Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Go to Record/Request/Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Go to Related Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Halt Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Import Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Insert Audio/Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Insert Calculated Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Insert Current Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Insert Current Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Insert Current User Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Insert File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Insert From Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Insert From Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Insert From Last Visited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Insert From URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Insert PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Insert Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Insert Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Install Menu Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Install OnTimer Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Install Plug-In File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Modify Last Find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Move/Resize Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
New File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
New Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
New Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Omit Multiple Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Omit Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Open Edit Saved Finds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Open File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Open File Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Open Find/Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Open Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Open Manage Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Open Manage Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229
Open Manage Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Open Manage Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Open Manage Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Open Manage Value Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Open Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Open Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Open Remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Open Script Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Open Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Open URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Script steps reference (alphabetical list)
FILEMAKER PRO SCRIPT STEPS REFERENCE 9
Paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Pause/Resume Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Perform AppleScript (OS X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Perform Find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Perform Find/Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Perform Quick Find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Perform Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Perform Script On Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Print Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Recover File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Refresh Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Refresh Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Refresh Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Re-Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Relookup Field Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Replace Field Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Reset Account Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Revert Record/Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Save a Copy as . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Save Records As Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Save Records As PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Save Records As Snapshot Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Scroll Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Select All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Select Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Select Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Send DDE Execute (Windows) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Send Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Send Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Set Allowed Orientations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Set Error Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Set Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Set Field By Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Set Layout Object Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Set Multi-User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Set Next Serial Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Set Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Set Use System Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Set Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Set Web Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Set Window Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Set Zoom Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Show All Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Show Custom Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Show Omitted Only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Show/Hide Menubar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Show/Hide Text Ruler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Show/Hide Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Sort Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Sort Records by Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Speak (OS X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Spelling Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Truncate Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Script steps reference (alphabetical list)
FILEMAKER PRO SCRIPT STEPS REFERENCE 10
Undo/Redo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Unsort Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Upload To FileMaker Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
View As . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
About script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 11
About script steps
Creating scripts to automate tasks
Scripts can do simple tasks like setting print orientation or complex tasks like preparing a
customized mailing to each client.
For example, you could define a complex set of tasks that creates a thank you email to clients in the
Clients database who have made purchases in the last week. The script composes an email tailored
to each client. The script switches to Preview mode and pauses so you can see what the message
looks like before it is sent. The whole task is initiated by clicking a button on the Sales Entry layout.
You build scripts by selecting from a list of FileMaker Pro commands, called scripts steps, specifying
options (if necessary), and arranging the steps in the correct order to perform the task.
Using this script steps reference
The content in this document was originally written for FileMaker Pro Help. It has been collected in
this format to allow solution developers to read the information independent of the help system.
Links to help topics may not work in this format.
Script step topics are organized by category. Each script step topic describes what the script step
does, and what its options and parameters are. Each topic also shows the format for the script step
and provides a usage example.
Learning about scripts
If you’re new to scripting, use the following resources to learn about scripts.
To view help topics about scripting:
In FileMaker Pro, choose Help menu > FileMaker Pro Help. In Help, choose Automating
tasks with scripts. You can also search help for information about scripting.
To view all help topics about individual script steps:
In FileMaker Pro, choose Help > FileMaker Pro Help. In Help, choose Reference > Script
steps reference.
To view answers to frequently asked questions, tips, troubleshooting advice, and more, visit the
FileMaker Knowledge Base at http://help.filemaker.com.
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 12
Control script steps
Control script steps control the progression of the script by letting you tell FileMaker Pro exactly
what to do when and if specific conditions occur.
Use these script steps to:
call scripts and sub-scripts
pause and resume a script, based on defined conditions
conditionally perform script steps using if/then/else logic
stop a script before it's finished, if a specific condition is met
create loops that repetitively carry out a sequence of steps in a script, until a condition is
met
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 13
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
<script name> specifies the script you want to perform.
Optional script parameter specifies a script parameter for the specified script.
See Specify Script dialog box.
Compatibility
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.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Partial
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 14
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.
exist only for the duration of the script. Script parameters are reset each time a script is
performed.
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.
can contain multiple values separated by carriage returns. Use the LeftValues function,
MiddleValues function, and RightValues function to isolate a specific parameter.
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
If you are using FileMaker Pro Advanced to define a custom menu item that performs a
script, select the script and optional script parameters. For more information, see Defining
custom menus (FileMaker Pro Advanced).
For scripts run via FileMaker WebDirect or Custom Web Publishing, the files containing the
scripts must on the same FileMaker Server and have the appropriate extended privileges
enabled to permit access. See Editing extended privileges fofr a privilege set.
A runtime solution can perform an external script only if the external file is bound to the
solution.
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; With dialog: Off]
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 15
Perform Script On Server
Purpose
Performs a script on the server that is hosting the current file.
Format
Perform Script on Server [Wait for completion; "<script name>"; Parameter:
<parameter>]
Options
<script name> specifies the script you want to perform. See Specify Script dialog box.
Optional script parameter specifies a script parameter for the specified script.
Wait for completion pauses the script on the client until the sub-script called by Perform
Script On Server is completed on the host. Wait for completion must be selected to pass a
script result or error code from the host to the client. Use the Get(ScriptResult) function to
capture a result or the Get(LastError) function to capture an error code.
Compatibility
Originated in
FileMaker Pro 13.0
Description
The current file must be hosted on FileMaker Server. Otherwise, Perform Script On Server returns
an error. See About running scripts on FileMaker Server.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution No
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 16
Example 1
Runs a script on the server and sends the current layout name, customer ID, and customer email
address as the script parameter. The server navigates to the layout and record specified in the
parameter, saves a snapshot link of the current record, emails the snapshot link to the email address
specified in the parameter, and returns a result. The client fetches the script result from the server
and displays it in a custom dialog box.
Main script: Email snapshot link (Client)
Perform Script on Server [Wait for completion; "Email snapshot link
(Server)"; Parameter: List ( Get ( LayoutName ) ; Customers::ID ;
Customers::Email )]
Show Custom Dialog [Get ( ScriptResult )]
Sub-script: Email snapshot link (Server)
Go to Layout [GetValue ( Get ( ScriptParameter ) ; 1 )]
Enter Find Mode [Pause: Off]
Set Field [Customers::ID; GetValue ( Get ( ScriptParameter ) ; 2 )]
Perform Find [ ]
Set Variable [$PATH; Value:Get ( TemporaryPath ) & "Snapshot.fmpsl"]
Save Records as Snapshot Link ["$PATH"; Current record]
Send Mail [Send via SMTP Server; With dialog: Off; To: GetValue ( Get (
ScriptParameter ) ; 3 ); "$PATH"]
Exit Script [Text Result: "Snapshot link sent."]
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 17
Pause/Resume Script
Purpose
Pauses a script so the user can perform other tasks in the current window.
Format
Pause/Resume Script [Indefinitely/Duration (seconds) <n>]
Options
Indefinitely pauses the script until the user clicks Continue (a button created by
FileMaker Pro in the status toolbar) or presses Enter.
For duration pauses the script for the number of seconds you specify.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step can, for example, wait for a user to enter data, and then guide the user from screen
to screen, prompting for data entry as needed. You can also use Pause/Resume Script to help
debug your scripts, for example, to see what value is in a field at a particular point in a script or to
evaluate the progress of a script.
The Pause/Resume Script script step operates on the foreground window of the file from which the
script is performed. If the script’s current window is hidden, Pause/Resume Script brings that
window to the front and shows it.
The For duration value must evaluate as a number, which is the duration of the pause in seconds.
If you use the Specify Calculation dialog box to determine the duration, the calculation result must
be a number or your script will not pause.
To give you more control over a user's actions when a script pauses, FileMaker Pro makes some
menu commands unavailable to users. You can define buttons to let users perform actions not
available on the menus.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 18
Notes
A Pause/Resume Script step unfreezes a Freeze Window script step.
In FileMaker WebDirect, if the Pause/Resume Script step pauses a script and the web user
is idle for longer than the session timeout specified in the FileMaker Server Admin Console,
the web user’s connection will close and the script will end early, which may lead to
unexpected results.
In Custom Web Publishing, this script step is supported, but you should avoid using it. If the
script remains in a paused state until the session times out, then the script will not be
completed.
Example 1
Goes to the Print Invoices layout and pauses. The user can click a Continue button on the status
toolbar or the layout to print the records.
Go to Layout ["Print Invoices"]
Pause/Resume Script [Indefinitely]
Print [Restore: Printer; With dialog: Off]
Go to Layout [original layout]
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 19
Exit Script
Purpose
Forces the running script, sub-script, or external script to stop immediately.
Format
Exit Script [Text Result: <value or formula>]
Options
<value or formula> specifies a text value to pass back to the parent script. The value is typically
based on the state of the current script.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If Exit Script is used in a sub-script, returns to the main script with or without an optional script result.
If the optional script result is specified, the script result is returned and stored in the main script until
another sub-script that returns a value is called. The script result gets deleted when you exit the
main script. The script result can be stored in a local or global variable for later use.
Example 1
Performs a find and prints. If no records are found, displays all records and exits the script.
Perform Find [Restore]
If [Get ( FoundCount ) = 0]
Show All Records
Exit Script [Text Result: ]
End If
Print [With dialog: Off]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 20
Example 2
Prints unpaid invoices. In the Print sub-script, users can choose whether they want to print invoices.
If users choose to print, then Exit Script uses a script result to enter “Printed on <current date>” in
the Status field.
Main script: Print Unpaid Invoices
New Window [Name: "Invoice List"; Style: Document]
Go to Layout ["Print Invoices"]
Perform Find [Restore]
#Calls the "Print" sub-script defined below
Perform Script ["Print"]
#Continues after the sub-script is completed
If [Get ( ScriptResult ) = 1]
Replace Field Contents [With dialog: Off; Invoices::Status;
"Printed on " & Get ( CurrentDate )]
Else
Show All Records
Sort Records [Restore; With dialog: Off]
End If
Sub-script: Print
Show Custom Dialog ["Print Unpaid Invoices"; "Do you want to print
unpaid invoices?"]
If [Get ( LastMessageChoice ) = 1]
Print [With dialog: Off]
Else
Close Window [Current Window]
End If
#Uses the Result parameter to pass the user’s choice to the main script
Exit Script [Text Result: Get ( LastMessageChoice )]
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 21
Halt Script
Purpose
Forces all scripts, sub-scripts, or external scripts running in the current FileMaker application to stop
immediately.
Format
Halt Script
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Halt Script can leave your database in an unpredictable state. For example, the script might halt in
an unanticipated layout, view, or mode.
Example 1
Performs a find and prints. If no records are found, displays all records and halts the script.
Perform Find [Restore]
If [Get ( FoundCount ) = 0]
Show All Records
Halt Script
End If
Print [With dialog: Off]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 22
Example 2
The Print Unpaid Invoices script calls the Print sub-script. If the user chooses not to print invoices,
the script and sub-script stop. If the user chooses to print invoices, unpaid invoices that match the
Find criteria are printed. After printing, all records are displayed and sorted.
Main script: Print Unpaid Invoices
New Window [Name: "Invoice List"; Style: Document]
Go to Layout ["Print Invoices"]
Perform Find [Restore]
#Calls the "Print" sub-script defined below
Perform Script ["Print"]
#Continues after the sub-script is completed if the user chose to print
the invoices
Show All Records
Sort Records [Restore; With dialog: Off]
Sub-script: Print
Show Custom Dialog ["Print Unpaid Invoices"; "Do you want to print
unpaid invoices?"]
If [Get ( LastMessageChoice ) = 1]
Print [With dialog: Off]
Else
Close Window [Current Window]
#Halts both the sub-script and the main script
Halt Script
End If
Control script steps
FILEMAKER PRO 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; With dialog: Off]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 24
Example 2
Performs a find. If no records are found, displays a custom dialog box. If records are found, sorts the
found set.
Perform Find [Restore]
If [Get ( FoundCount ) = 0]
Show Custom Dialog ["Find Records"; "No records were found."]
Else
Sort Records [Restore; With dialog: Off]
End If
Example 3
Performs a find. If no records are found, displays a custom dialog box. If one record is found, goes
to the Invoice Details layout. If more than one record is found, goes to the Invoices layout.
Perform Find [Restore]
If [Get (FoundCount) = 0]
Show Custom Dialog ["Find Records"; "No record was found."]
Else If [Get (FoundCount) = 1]
Go to Layout ["Invoice Details"]
Else
Go to Layout ["Invoices"]
End If
Example 4
Performs a find. If no records are found, displays a custom dialog box so the user can run the Find
Invoices script to search again. If one record is found, goes to the Invoice Details layout. If more
than one record is found, goes to the Invoices layout.
Script: Find Invoices
Perform Find [ ]
If [Get ( FoundCount ) = 0]
Show Custom Dialog ["No Record Found"; "No records were found. Do
you want to search again?"]
If [Get ( LastMessageChoice ) = 1]
#Calls this script again as a sub-script
Perform Script ["Find Invoices"]
Else
Show All Records
End If
Else If [Get ( FoundCount ) = 1]
Go to Layout ["Invoice Details"]
Else
Go to Layout ["Invoices"]
End If
Sort Records [Restore; With dialog: Off]
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 25
Else If
Purpose
Evaluates a Boolean calculation and performs a conditional action based on that evaluation, like If.
Format
Else If [<Boolean calculation>]
Options
<Boolean calculation> specifies the calculation you want evaluated.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Else If must follow an If or another Else If script step. Else If cannot follow an Else script step.
When an If script step evaluates to false, script execution moves to the Else If script step. When an
Else If statement evaluates to true, the block of steps under the Else If is executed. An evaluation of
true ends the Else If process, and upon reaching the next Else If or Else statement, execution will
skip to the End If script step.
Example 1
Performs a find and sorts records. If no records match the find request, displays a custom dialog
box.
Perform Find [Restore]
If [ Get ( LastError ) = 0 ]
Sort Records [Restore; With dialog: Off]
Else If [ Get ( LastError ) = 401 ]
Show Custom Dialog ["No records were found."]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 26
Else
Purpose
Performs an alternate set of script steps when an If or Else If script step evaluates to false.
Format
Else
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Else must follow an If script step or Else If script step. Else cannot follow another Else script step.
When all If script steps and Else If script steps evaluate to false, script execution moves to the Else
script step. The script steps under Else are executed, and script execution moves to the End If script
step.
Example 1
Performs a find. If no records are found, displays a custom dialog box. If records are found, sorts the
found set.
Perform Find [Restore]
If [Get ( FoundCount ) = 0]
Show Custom Dialog ["Find Records"; "No records were found."]
Else
Sort Records [Restore; With dialog: Off]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 27
End If
Purpose
Marks the end of an If script step structure.
Format
End If
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Every If script step must have a corresponding End If script step somewhere after it at the same
indentation. Whenever you use an If script step, the script editing pane automatically enters an End
If step.
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; With dialog: Off]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 28
Loop
Purpose
Repeats a set of script steps, to perform batch processes.
Format
Loop
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Use Loop, for example, for exporting container field contents from all records in a found set. This
script step and the End Loop script step mark the beginning and end of a repeating structure of
script steps. The script performs the script steps that are enclosed within the loop structure until it
encounters one of the following:
an Exit Loop If script step
a Go to Record/Request/Page script step or Go to Portal Row script step when the Exit
after last option is selected
Every Loop step must have a corresponding End Loop step somewhere after the Loop step and at
the same indentation. Whenever you use a Loop script step, the script editing pane automatically
enters an End Loop step.
Example 1
Copies the contents of the Customers::Work Phone to Customer::Day Contact in all records.
Go to Record/Request/Page [First]
Loop
Set Field [Customers::Day Contact; Customers::Work Phone]
Go to Record/Request/Page [Next; Exit after last]
End Loop
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 29
Example 2
Loops through records to export files that are in the Container field.
Set Variable [$PATH; Value: Get ( DocumentsPath ) & Products::Container]
Go to Record/Request/Page [First]
Loop
Export Field Contents [Products::Container; "$PATH"]
Go to Record/Request/Page [Next; Exit after last]
End Loop
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 30
Exit Loop If
Purpose
Exits a loop if the specified calculation is true (not zero).
Format
Exit Loop 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 is true (not zero), the script continues with the script step that follows the End Loop
script step.
If the calculation if false (zero), the loop is not exited and the script continues with the script step that
follows the Exit Loop If script step.
Example 1
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
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 31
End Loop
Purpose
Marks the end of a Loop script structure.
Format
End Loop
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Whenever you use a Loop script step, the script editing pane automatically enters an End Loop
step. The steps between Loop and End Loop are automatically indented and the End Loop step is
placed at the same indentation level as its corresponding Loop step.
Example 1
Copies the data from Customers::Work Phone to Customers::Day Contact in all records.
Go to Record/Request/Page [First]
Loop
Set Field [Customers::Day Contact; Customers::Work Phone]
Go to Record/Request/Page [Next; Exit after last]
End Loop
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 32
Allow User Abort
Purpose
Allows or prevents users from stopping a running script.
Format
Allow User Abort [<On/Off>]
Options
On allows users to stop a script by pressing Esc or Command-.(period) (OS X).
Off prevents users from stopping a script by pressing Esc or Command-.(period) (OS X).
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
The Allow User Abort script step affects the script that it is executed in and all sub-scripts.
By default, users can stop a script by pressing Esc or Command-.(period) (OS X). To prevent users
from stopping a script, use the Allow User Abort script step and set it to Off.
By default, unknown (obsolete or unrecognized) script steps will stop a script. To change this
behavior, set the Allow User Abort script step to one of the following. In either case, unknown script
steps return FileMaker Pro error 4 (“Command is unknown”).
On (default) allows unknown script steps to stop the script
Off skips unknown script steps and allows the script to continue to run
Notes
Clients can’t abort server-side scripts or scripts performed via Custom Web Publishing. In
these cases, this script step determines only whether unknown script steps are skipped.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 33
Example 1
Displays the records in the Print Invoices layout in a new window in Preview mode and pauses the
script. You can click Continue to print the invoices, or you can cancel printing in the Print dialog box
because in the Print script step, the With dialog option is On. Allow User Abort is Off so that you
aren't left with an extra window open if you cancel the script.
Allow User Abort [Off]
New Window [Name: "Print Invoices"; Style: Floating Document]
Go to Layout ["Print Invoices"]
Enter Preview Mode [Pause: On]
Print [Restore: Printer; With dialog: On]
Close Window [Current Window]
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 34
Set Error Capture
Purpose
Suppresses or enables normal FileMaker Pro alert messages.
Format
Set Error Capture [<On/Off>]
Options
On suppresses FileMaker Pro alert messages and some dialog boxes. If the error result is
100 or 803, then certain standard file dialog boxes are suppressed, such as the Open File
dialog box.
Off re-enables the alert messages.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Use this script step to suppress normal FileMaker alert messages caused by subsequent script
steps so that your script can handle errors instead. It is important that you anticipate as many
problems as possible and include clear instructions for what to do for an error condition.
By using Get(LastError) function with certain control script steps, you can check whether the
previous script step returned an error and take the appropriate action.
Notes
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.
When Set Error Capture is used in a script that contains a sub-script, errors from the sub-
script are captured as well.
Server-side scripts and scripts performed via Custom Web Publishing always run as if Set
Error Capture were set to On. See About running scripts on FileMaker Server.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 35
Example 1
Performs a find and suppresses the error dialog box if no records were found.
Set Error Capture [On]
Perform Find [Restore]
Example 2
Performs a find. If no errors occur, sorts records. If no find criteria were specified, shows all records.
If no records match the find request, displays a custom dialog box.
Set Error Capture [On]
Perform Find [Restore]
If [Get ( LastError ) = 0]
Sort Records [Restore; With dialog: Off]
Else If [Get ( LastError ) = 400]
Show All Records
Else If [Get ( LastError ) = 401]
Show Custom Dialog ["Find"; "No records were found."]
End If
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 36
Set Variable
Purpose
Sets a local or global variable to a specified value.
Format
Set Variable [<variable name> {[<repetition number>]}; Value:<value or
formula>]
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.
Compatibility
Originated in
FileMaker Pro 8.0
Description
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 About naming fields.
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.
A global variable can be used in a calculation or script anywhere in a file, for example, other
scripts or file paths. The value of a global variable is not cleared until the file is closed.
Local and global variables (or even two local variables in different scripts) can have the
same name but they are treated as different variables and can store different values.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 37
Example 1
Creates a related record by using a local variable to copy information into a match field.
Set Variable [$CURRENT_CUSTOMER_ID; Value: Customers::Customer ID]
Go to Layout ["Invoice Details"]
New Record/Request
Set Field [Invoices::Customer ID; $CURRENT_CUSTOMER_ID]
Example 2
Uses a local variable to save records as Excel or PDF files in the Documents folder.
Show Custom Dialog ["Save the current record as Excel or PDF?"]
If [Get ( LastMessageChoice ) = 1]
Set Variable [$PATH; Value: Get ( DocumentsPath ) & "Invoice " &
Invoice::Invoice Number & ".xlsx"]
Save Records as Excel [Restore; With dialog: Off; "$PATH"; Current
record]
Else
Set Variable [$PATH; Value: Get ( DocumentsPath ) & "Invoice " &
Invoice::Invoice Number & ".pdf"]
Save Records as PDF [Restore; With dialog: Off; "$PATH"; Current
record"]
End If
Example 3
Uses global variable as a toggle to stop a script from being triggered.
Script: Go to Selected Invoice for iOS
Set Variable [$$SCRIPT_TRIGGER; Value: "Off"]
Go to Layout ["Invoice Details iPad"]
Script: Trigger Entering Invoice Details
If [$$SCRIPT_TRIGGER = "Off"]
Set Variable [$$SCRIPT_TRIGGER; Value: "On"]
Exit Script [Text Result: ]
End If
Find Matching Records [Replace; Invoices::Customer Name]
Go to Record/Request/Page [First]
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 38
Set Layout Object Animation
Purpose
Enables or disables animations while a script is running.
Format
Set Layout Object Animation [<On/Off>]
Options
On enables animations while a script is running.
Off disables animations while a script is running.
Compatibility
Originated in
FileMaker Pro 13.0
Description
Enabling animations increases the time required for a script to run. Disabling animations overrides
any animation settings for other script steps. This script step affects all script-initiated animations in
all windows.
Note Set Layout Object Animation does not return an error when it runs in a FileMaker product in
which animations are not supported.
Example 1
While a script is running, animations are typically disabled. If a script causes a slide control to switch
between panels, there will be no animation providing feedback to users. To call attention to the
transition from panel to panel, use Set Layout Object Animation [On] to enable animation
prior to switching between slide panels using the Go to Object script step.
Set Layout Object Animation [On]
Go to Object [Object Name: "Panel 1"]
Pause/Resume Script [Duration (seconds): .5]
Go to Object [Object Name: "Panel 2"]
Pause/Resume Script [Duration (seconds): .5]
Go to Object [Object Name: "Panel 3"]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 39
Install OnTimer Script
Purpose
Runs a specified script at the specified interval.
Format
Install OnTimer Script [“<script>”; Parameter: <script parameter>;
Interval: <number>]
Options
Specify script lets you specify the script you want to perform.
Optional script parameter lets you specify a script parameter for the specified script.
Interval seconds is the value in seconds that the timer waits before running the script.
Compatibility
Originated in
FileMaker Pro 10.0
Description
This script step installs a single timer on the active window and repeats the specified script in that
window until another Install OnTimer Script step installs a timer on the window or until the window
closes. You can halt an installed timer by running another Install OnTimer Script step without
specifying a script or interval.
Notes
If a script is running, any scripts associated with timers will not run until the script that is
running finishes.
If the active window has an installed timer and the user or a script opens a new window, the
new window inherits the timer.
Each window can have a separate timer operating at the same time. Timers continue to run
even if windows are in the background or hidden. If you’re using dialog windows and timers,
see About window styles.
To run scripts on a schedule and independently of open windows, see FileMaker Server
Help.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect Yes
Runtime solution Yes
Control script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 40
Example 1
Uses the Install OnTimer Script step to run the Clock script once every minute.
Script: Clock OnTimer
Install OnTimer Script [“Clock”; Interval: 60]
Script: Clock
Set Field [Clock::Time; Get ( CurrentTime )]
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 41
Navigation script steps
Navigation script steps move to different areas of a database. Use Navigation script steps to:
go to a specific record or find request
switch to a specific layout
move among fields and other objects on a layout
emulate pressing Enter or Tab
switch to Browse mode to work with contents of a file
switch to Find mode to fill out find requests
switch to Preview mode to see how records, forms, or reports will look when they're printed
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 42
Go to Layout
Purpose
Switches to the specified layout.
Format
Go to Layout [“<layout name or layout number>”]
Options
original layout is the active layout when the script is initiated.
Layout specifies a layout by name from the list of layouts you’ve defined in your file.
Layout Name by calculation specifies a formula whose result is a valid layout name.
Layout Number by calculation specifies a formula whose result is a valid layout number.
(Layout numbers correspond to the order of the layouts in the file.)
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step is useful when you begin a script to make sure the user starts with the correct layout
displayed.
Notes
The Go to Layout script step can only take you to layouts defined in the same file as the
script itself. To go to layouts in an external file, define a script in that file using the Go to
Layout script step, and call that script from the first file using the Perform Script script step.
Layout Name by calculation recognizes layouts with the same names in the order in which
they were created. If you have multiple layouts with the same name, either select the
specific layout you want from the layout list or use Layout Number by calculation.
Define an unstored calculation field with the function Get(LayoutNumber) function and place
it on your layouts to verify the layout numbers of your layouts.
When a file has two or more tables, FileMaker Pro appends the name of the source table to
the layout name for clarity. For example, Go to Layout [“Layout #2” (TableB)].
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 43
Example 1
Opens a new window and goes to the Summary field on the Invoice Details layout.
New Window [Style: Document]
Go to Layout ["Invoice Details"]
Go to Field [Invoices::Summary]
Example 2
Checks which device is running the database and goes to the appropriate layout.
If [PatternCount ( Get ( ApplicationVersion ); "iPad" )]
Go to Layout ["Customers iPad"]
Else If [PatternCount ( Get ( ApplicationVersion ); "Pro" )]
Go to Layout ["Customers"]
Else
Go to Layout ["Customers iPhone"]
End If
Sort Records [Restore; With dialog: Off]
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 44
Go to Record/Request/Page
Purpose
Moves to a record or a report page, or displays a find request.
Format
Go to Record/Request/Page [<First/Last/Previous/Next/By Calculation>]
Options
First moves to the first record in the file or found set (Browse mode), displays the first find
request (Find mode), or moves to the first page in a report (Preview mode).
Last moves to the last record in the file or found set, displays the last find request, or moves
to the last page in a report.
Previous moves to the previous record in the file or found set, displays the previous find
request, or moves to the previous page in a report. Exit after last tells FileMaker Pro to stop
the script when it reaches the last record in the found set. You can use Exit after last with
the Loop script step to exit out of a loop after the last record.
Next moves to the next record in the file or found set, displays the next find request, or
moves to the next page in a report. Exit after last tells FileMaker Pro to exit the script or
control structure (like a loop) when it reaches the last record in the found set.
By Calculation specifies a calculation to determine the desired record number, find request
number, or page number. Set With dialog to On to display the number in a dialog box for
confirmation.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
In Browse mode, this script step moves to a record; in Find mode it displays a find request, and in
Preview mode it moves to a report page.
Server-side scripts and Customer Web Publishing do not support the By Calculation option.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 45
Example 1
Performs a find, sorts the records, and goes to the first record.
Perform Find [Restore]
Sort Records [Restore; With dialog: Off]
Go to Record/Request/Page [First]
Example 2
Goes to the record number the user enters in the custom dialog box.
Show Custom Dialog ["Enter the record number you want to view.";
Invoices::Record Number]
Go to Record/Request/Page [Invoices::Record Number]
Show All Records
Example 3
Loops through records to export files that are in the Container field. 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
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 46
Go to Related Record
Purpose
Goes to the current related record(s) in a related table.
Format
Go to Related Record [From table: “<table name>”; Using layout “<layout
name>”; New window]
Options
Get related record from specifies the source relationship from a list of tables in the current
database. If the table is not in the list or if you need to add or change a relationship, Manage
Database displays the Manage Database dialog box, where you can create or edit
relationships.
Show record using layout specifies the layout in the current file that will be used to display
the related record(s).
Use external table’s layouts opens the file containing the external table you specify and
lets you choose a layout from that file in which to display the related record(s). This option is
only available if the source relationship you selected references a table in another file.
Show in new window shows the related records in a new window and lets you specify the
settings for the new window. For more information, see New Window script step.
Tip To bring the new window with the related record(s) to the front automatically, add the Select
Window script step.
Show only related records creates a new found set in the related table with the options
either to match the current record or to match the entire found set. The first record in the
found set becomes the current record. (If you don’t select this option, Go to Related Record
makes the first record in the table’s unsorted order the current record.)
Match current record only creates a new found set in the related table containing a set of
records that match the current record. For example, if there are three records in the related
invoice table that match the customer record in the customer table you are currently
viewing, and you want to see all three invoices, use Match current record only to display
the three invoices.
Match all records in the current found set creates a new found set in the related table
that matches all records in the current found set. For example, if you have a found set of ten
customers and there are forty invoices in the invoice table that match any of these ten
customers, use Match all records in the current found set to display the forty matching
invoices. If you don’t define a sort order, the found set will be unsorted.
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 47
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Suppose you have an Invoices table that's related to a Customers table and you're currently looking
at a particular invoice. In the Invoices table, you have a button that's set to Go to Related Record
[Customers]. Clicking this button determines which customer record your current invoice is related
to and immediately goes to that record in the Customers table. If the record in question is not
currently in the Customers table’s found set, the script can perform a find to make the record
current.
Tip If the related records cannot be found, this script step returns an error code which can be
captured with the Get(LastError) function.
This script step also works with portal rows. If this script step is used from an active portal row, and
the portal’s table is the related table, then the related record in that table is made current. If the
portal’s table is not the related table, the first related record in the found set is made current.
When used with a table in an external file, this script step will open the file containing the external
table and, if selected, go to the external layout you specify.
There are situations in which a script containing the Go to Related Record script step could modify
an unintended set of records. For example:
If the related records cannot be found, this script step remains on the current layout.
If you select a table occurrence to which there’s no relationship, or a layout that doesn’t
refer to the correct table occurrence, FileMaker Pro displays an error message. After the
error message displays, script execution continues with the next script step.
If there are no related records or no record in the active portal row, the script might produce
unexpected results. Use the IsEmpty function to determine if there are no related records
before using Go to Related Record.
If you have Allow creation of related records enabled and Go to Related Record is
executed from an empty portal row, the script might produce unintended results.
Notes
The sort order is not maintained if the related records are in an external file.
If you are filtering records in a portal, this script step exposes all of the records, not just the
filtered records.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 48
Example 1
Goes to a related record in the Invoices table and sorts the found set of related records.
Go to Related Record [Show only related records; From table: "Invoices";
Using layout: “Invoices”]
Sort Records [Restore; With dialog: Off]
Go to Record/Request/Page [First]
Example 2
Goes to a related record in the Invoices table and sorts the found set of related records in a new
window.
Go to Related Record [Show only related records; From table: "Invoices";
Using layout: “Invoices”; New Window]
Sort Records [Restore; With dialog: Off]
Go to Record/Request/Page [First]
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 49
Go to Portal Row
Purpose
Navigates among the rows in the active portal.
Format
Go to Portal Row [Select; <First/Last/Previous/Next/By Calculation>]
Options
Select entire contents selects the entire portal row. If select entire contents isn’t selected,
only one related field in the portal is active.
First moves to the first row in the portal.
Last moves to the last row in the portal.
Previous moves to the previous row in the portal. Exit after last tells FileMaker Pro to exit
the script when it reaches the last portal row. You can use Exit after last within a loop to exit
the loop after the last portal row.
Next moves to the next row in the portal. Exit after last tells FileMaker Pro to exit the script
when it reaches the last portal row. You can use Exit after last within a loop to exit the loop
after the last portal row.
By Calculation moves to the row number that is the result of the calculation you create, or
to the row number confirmed in a dialog box if you set With dialog to On.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
When no portal is active, the script uses the first portal in the layout stacking order.
This script step tries to keep the same related field selected when changing rows. If no field in a
portal is selected, the script selects the first related field it can enter.
When a related field in a portal is selected, you can use this step to move to the same field in
another portal row. For example, if the third field in the second portal row is selected, Go to Portal
Row [Next] goes to the third field in the third portal row.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Partial
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 50
Notes
In FileMaker WebDirect, the cursor moves next to the specified row, but the row is not
selected.
Server-side scripts and Custom Web Publishing do not support the By Calculation option.
Example 1
Goes to the last row of a portal to create a record.
Go to Field [Related Invoices::Summary]
Go to Portal Row [Last]
Example 2
Allows a user to make batch updates to the Status field in a portal.
Go to Portal Row [Select; First]
Loop
Go to Field [Select/perform; Invoices::Status]
Pause/Resume Script [Indefinitely]
Go to Portal Row [Next; Exit after last]
End Loop
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 51
Go to Object
Purpose
Moves to the specified object on the current layout.
Format
Go to Object [Object Name: "<object name>"; Repetition: <value or
formula>]
Options
Object Name is the named object to make active on the current layout. To assign an object
name, choose View menu > Inspector in Layout mode. Click the Position tab, then
enter a name for the object.
Repetition (optional) lets you choose a field's repetition to go to. Otherwise defaults to 1.
This option is ignored if the object is not a field.
Compatibility
Originated in
FileMaker Pro 8.5
Description
This script step uses an object name to identify an object, so you must assign a unique object name
to each object on a layout that you want to go to.
Notes
If this script step specifies an object on a tab panel or a slide panel that is not the front-most
panel, the specified object is selected and the panel it is on moves to the front of the panel
control.
If the script step specifies a field on a popover, the popover opens.
Example 1
Navigates to a text field named "First Name".
Go to Object [Object Name: "First Name"]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 52
Example 2
Navigates between different tabs of a tab control.
If [Invoices::Status = "Paid"]
Go to Object [Object Name: "Invoice Statement Tab"]
Else If [Invoices::Status = "Unpaid"]
Go to Object [Object Name: "Invoice Payment Tab"]
End If
Example 3
Navigates to either the "Paid" tab or the "Unpaid" tab in a tab control depending on the value of
Invoices::Status.
Go to Layout ["Invoice Details"]
Go to Object [Object Name: Invoices::Status]
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 53
Go to Field
Purpose
Moves to the specified field on the current layout.
Format
Go to Field [Select/perform; <table::field>]
Options
Select/perform tells FileMaker Pro to select all contents of a field. For example, if the
primary command is Edit, Select/perform opens the document in a state ready for editing.
Go to target field specifies the target field.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Notes
If this script step specifies a field on a tab panel or a slide panel that is not the front-most
panel, the specified field is selected and the panel it is on moves to the front of the panel
control. If, however, the same field appears elsewhere on the layout and the script finds that
field first, the panel with that same field will not come forward. You can force FileMaker Pro
to find a specific field by assigning an object name to the field and using the Go to Object
script step to move to that instance of the field. If the object is a repeating field, you can also
specify which repetition that you want to go to.
If the script step specifies a field on a popover, the popover opens.
In FileMaker WebDirect:
The cursor moves to the specified field.
If the target field is not visible in the web browser window, Go to Field does not scroll the
window to make the target field visible.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 54
Example 1
Goes to the Invoice Details layout, creates a record, and goes to the Summary field.
Go to Layout ["Invoice Details"]
New Record/Request
Go to Field [Invoices::Summary]
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 55
Go to Next Field
Purpose
Moves to the next field in the tab order of the current layout.
Format
Go to Next Field
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If no field is selected when this script step is performed, this script step moves to the first field in the
tab order of the current layout. If a field is formatted as a button, the field object is selected, not the
button object.
Note In FileMaker WebDirect, the cursor moves to the selected field.
Example 1
Goes to the next field in the tab order unless the Status field in the current record is empty.
If [IsEmpty ( Invoices::Status )]
Show Custom Dialog ["Invoice Status cannot be empty."]
Else
Go to Next Field
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 56
Go to Previous Field
Purpose
Moves to the previous field in the tab order of the current layout.
Format
Go to Previous Field
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If no field is selected when this script step is performed, this script step moves to the last field of the
tab order of the current layout. If a field is formatted as a button, the field object is selected, not the
button object.
Note In FileMaker WebDirect, the cursor moves to the selected field.
Example 1
Controls field entry validation. Can be started with the OnObjectExit script trigger.
If [IsEmpty ( Customers::First Name )]
Show Custom Dialog ["You must enter a first name."]
Go to Previous Field
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 57
Close Popover
Purpose
Closes an open popover in the window in which the script step runs.
Format
Close Popover
Options
None.
Compatibility
Originated in
FileMaker Pro 13.0
Description
Closes an open popover in the target window. If no popover is open, Close Popover does nothing
and does not return an error code.
Example 1
Closes the open popover and navigates to either the "Paid" or the "Unpaid" tab of a tab control
depending on the value of Invoices::Status.
Close Popover
Go to Object [Object name: Invoices::Status]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 58
Enter Browse Mode
Purpose
Switches to Browse mode.
Format
Enter Browse Mode [Pause: Off/On]
Options
Pause temporarily stops the script to allow users to enter data.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Example 1
Goes to the Print invoices layout, enters Preview mode, prints, and enters Browse mode.
Go to Layout ["Print Invoices"]
Enter Preview Mode [Pause: Off]
Print [With dialog: Off]
Enter Browse Mode [Pause: Off]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 59
Enter Find Mode
Purpose
Switches to Find mode.
Format
Enter Find Mode [Pause: On/Off]
Options
Pause temporarily stops the script to allow users to enter a find request.
Specify find requests allows you to create and edit requests for use with this script step.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
When you select Specify find requests at the time the script step is defined, FileMaker Pro
displays the current find request(s), if any. Additional find requests can be defined, and existing find
requests can be duplicated, edited, or deleted.
To edit a find request, select it from the list in the Specify Find Requests dialog box and click Edit.
In the Edit Find Requests dialog box, select the action (Find Records or Omit Records) you want
the find request to perform. A single find request can either find records or omit records, but cannot
perform both actions at the same time. Use multiple find requests to find and omit records from
within a single script step.
For each field in your request, specify the criteria for which you want FileMaker Pro to search.
Example 1
Goes to the Invoice Details layout, enters Find mode, pauses for user input, and performs the find.
Go to Layout ["Invoice Details"]
Enter Find Mode [Pause: On]
Perform Find [ ]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Navigation script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 60
Enter Preview Mode
Purpose
Switches to Preview mode.
Format
Enter Preview Mode [Pause: Off/On]
Options
Pause temporarily stops the script to allow users to examine the preview result before proceeding
with the next step in the script.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Example 1
Opens the Print Invoices layout in a new window, enters Preview mode, prints, and closes the
window.
New Window [Style: Floating Document]
Go to Layout ["Print Invoices"]
Enter Preview Mode [Pause: Off]
Print [With dialog: Off]
Close Window [Current Window]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go No
Custom Web Publishing No
FileMaker WebDirect No
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 61
Editing script steps
With editing script steps, you can cut, copy, paste, or clear the contents of a field; undo or redo
previous actions; or select the contents of a field.
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 62
Undo/Redo
Purpose
Reverses, restores, or switches between the most recently performed actions in the file.
Format
Undo/Redo [Undo/Redo/Toggle]
Options
Undo reverses the previously performed action in the file.
Redo restores the previously undone action in the file.
Toggle switches between the two most recently performed actions in the file.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Multiple actions can be undone by repeatedly executing this script step with the Undo option. The
number of actions that can be undone or redone is limited only by the amount of available memory.
Example 1
Undoes data entry if the Phone Number field has fewer than seven digits.
If [Length ( Customer::Phone Number ) < 7]
Show Custom Dialog ["Phone Number must contain at least 7 digits. Undo
number input?"]
If [Get ( LastMessageChoice ) = 1]
Undo/Redo [Undo]
End If
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 63
Cut
Purpose
Deletes the contents of the specified field in the current record and saves the contents to the
Clipboard.
Format
Cut [Select; <table::field>]
Options
Select entire contents deletes the contents of a field in the current record and saves it to
the Clipboard. If you do not use Select entire contents, only the selected portion of the
field's data is cut.
Go to target field specifies the field whose contents you want to cut.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step removes the contents of the field. To duplicate the field information, use the Copy
script step.
Notes
Contents that you cut or copy to the Clipboard are accessible to other applications.
With FileMaker WebDirect, the Cut script step does not place data onto the Clipboard.
If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run
this script step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Cuts the contents of the Email field in the current record.
Cut [Customers::Email]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Partial
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 64
Example 2
Prompts the user to either cut or copy the contents of the Email field.
Show Custom Dialog ["Do you want to cut or copy the customer's email
address?"]
If [Get ( LastMessageChoice ) = 1]
Cut [Customers::Email]
Else If [Get ( LastMessageChoice ) = 2]
Copy [Customers::Email]
End If
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 65
Copy
Purpose
Copies the contents of the specified field in the current record and saves the contents to the
Clipboard.
Format
Copy [Select; <table::field>]
Options
Select entire contents copies the entire contents of a field in the current record to the
Clipboard. If you do not use Select entire contents, only the selected portion of the field's
data is copied.
Go to target field specifies the field whose contents you want to copy. When no field is
specified and nothing is selected, FileMaker Pro copies the values from all fields of the
current record.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step duplicates the contents of the field. To remove the field information, use the Cut
script step.
Notes
Contents that you cut or copy to the Clipboard are accessible to other applications.
With FileMaker WebDirect, the Copy script step does not place data onto the Clipboard.
If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run
this script step in FileMaker WebDirect, use the Set Selection script step.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Partial
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 66
Example 1
Prompts the user to either cut or copy the contents of the Email field.
Show Custom Dialog ["Do you want to cut or copy the customer's email
address?"]
If [Get ( LastMessageChoice ) = 1]
Cut [Customers::Email]
Else If [Get ( LastMessageChoice ) = 2]
Copy [Customers::Email]
End If
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 67
Paste
Purpose
Pastes the contents of the Clipboard into the specified field in the current record.
Format
Paste [Select; No style; <table::field>]
Options
Select entire contents replaces the contents of a field with the contents of the Clipboard. If
you do not use Select entire contents, Paste copies the contents of the Clipboard to the
currently selected portion of the field.
Paste without style tells FileMaker Pro to ignore all text style and formatting associated
with the Clipboard contents.
Go to target field specifies the field to paste into.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If you try to paste data that doesn't match the field type of the target field, FileMaker Pro pastes the
data but displays a validation alert when you attempt to exit the field. If the field is not on the current
layout, FileMaker Pro returns an error code which can be captured with the Get(LastError) function.
Note If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run this script
step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Pastes the Clipboard contents into the active field.
Show Custom Dialog ["Do you want to paste the Clipboard contents?"]
If [Get ( LastMessageChoice ) = 1]
Paste [Select]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Partial
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 68
Clear
Purpose
Deletes the contents of the specified field in the current record.
Format
Clear [Select; <table::field>]
Options
Select entire contents deletes the entire contents of a field. If you do not use Select entire
contents, only the selected portion of the field's data is deleted.
Go to target field specifies the field whose contents you want to delete.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step removes the contents of the field in the current record without placing the contents
on the Clipboard. If you want to cut and paste the field information, use the Cut script step. Use
Undo immediately to restore the contents.
Note If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run this script
step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Clears the Email field in the current record.
Show Custom Dialog ["Do you want to clear the customer's email address?"]
If [Get ( LastMessageChoice ) = 1]
Clear [Select; Customers::Email]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Partial
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 69
Set Selection
Purpose
Designates the starting and ending position of a selection in a field.
Format
Set Selection [<table::field>; Start Position: <n>; End Position: <n>]
Options
Go to target field specifies the field whose contents you want to select.
Start Position specifies the starting position of the selection.
End Position specifies the ending position of the selection.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
The starting and ending values can be typed in directly or determined via a calculation. If no target
field is specified the current active field is used.
Notes
Field position is determined by the number of characters, including spaces, beginning with
position 1, the first character in the field. The selection includes all values beginning with the
Start Position and concluding with the End Position. For example, if Field1 has the value
abcdefgh”, and the script parameters specify a start position of “3” and an end position of
“6”, the script step will return the selection “cdef”.
If the start position is valid and the end position out of range, everything from the start
position to the end of the field is selected. If the end position only is valid, the cursor moves
to the end position, and nothing is selected. If both start and end positions are invalid, the
cursor moves to the end of the field contents.
No action is taken if the user attempts to perform a selection on a container field.
Data selected out of visual range is scrolled into view.
In FileMaker Go, this script step does not highlight selected text if the keyboard is hidden on
the device.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Partial
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 70
Example 1
Selects the first 5 digits of the Postal Code field.
Set Selection [Customers::Postal Code; Start Position: 1; End Position: 5]
Example 2
Selects the number of paragraphs that the user specifies in the custom dialog box.
Show Custom Dialog ["How many paragraphs do you want to select?";
Products::Number of Paragraphs]
If [Get ( LastMessageChoice ) = 1]
Set Selection [Products::Description; Start Position: 1; End Position:
Position ( Products::Description ; ¶ ; 1 ; Products::Number of Paragraphs
)]
End If
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 71
Select All
Purpose
Selects the entire contents of the active field.
Format
Select All
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Notes
In FileMaker Go, this script step does not highlight text if the keyboard is hidden on the
device.
Example 1
Selects the contents of the active field.
Show Custom Dialog ["Do you want to select the contents of the active
field?"]
If [Get ( LastMessageChoice ) = 1]
Select All
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Partial
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 72
Perform Find/Replace
Purpose
Finds/replaces data according to the options in the Perform Find/Replace Options dialog box.
Format
Perform Find/Replace [With dialog: On/Off; “<text to be found>”;
<replacement text>”; Find Next/Replace & Find/Replace/Replace All]
Options
With dialog specifies whether to display the Find/Replace Summary dialog box at the end
of the find/replace operation. Setting With dialog to Off also prevents display of the
confirmation dialog box when a Replace All operation is executed.
If you want the user to be able to enter find or replace criteria, use the Open Find/Replace script
step.
Perform lets you choose which action you want the find/replace to perform:
Find Next finds an instance of the find term.
Replace & Find finds an instance of the find term, then replaces the term and searches
for the next instance when the script is run again.
Replace replaces highlighted text that matches the find term with the replace term.
When using the Replace action, you may need to pair the Perform Find/Replace script
step with the Select All script step.
Replace All finds and replaces all instances of the find term.
Find what specifies the find term.
Replace with specifies text to replace instances of the find term.
Direction specifies the direction you want the find/replace to search through records.
Match case considers the find term’s case when performing the find.
Match whole words only omits finds where the find term is embedded in another word.
All records/requests finds within all records/requests in the found set.
Current records/requests restricts the find to the current record/request.
All fields finds within every field on the layout.
Current field restricts the find to within the active field. You can use the Go to Field script
step to select the field before the Find/Replace is performed.
Editing script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 73
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If Perform Find/Replace doesn't find data that matches the find term, it doesn’t return an error.
Example 1
Replaces text in the Reorder Level field that matches the find criteria in all records without
prompting the user.
Go to Field [Products::Reorder Level]
Perform Find/Replace [With dialog: Off; 1; 3; Replace All]
Example 2
Goes to the next occurrence of the product name in the Description field.
Show Custom Dialog ["Do you want to find the current product name in the
Description field?"]
If [Get ( LastMessageChoice ) = 1]
Go to Field [Products::Description]
Perform Find/Replace [With dialog: Off; Products::Name; Find Next]
End If
Example 3
Replaces specific terms in the current field with record data.
Show Custom Dialog ["Do you want to replace placeholder terms with record
data?"]
If [Get ( LastMessageChoice ) = 1]
Perform Find/Replace [With dialog: Off; "[NAME]"; Customers::Name;
Replace All]
Perform Find/Replace [With dialog: Off; "[COMPANY]";
Customers::Company; Replace All]
Perform Find/Replace [With dialog: Off; "[ADDRESS]";
Customers::Address; Replace All]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go No
Custom Web Publishing No
FileMaker WebDirect No
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 74
Fields script steps
Fields script steps operate on specific fields. With these script steps, you can:
paste data into fields
import information into fields and export data from fields
evaluate a calculation and assign the result to a field
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 75
Set Field
Purpose
Replaces the entire contents of the specified field in the current record with a calculation result.
Format
Set Field [<table::field>; <value or formula>]
Options
Specify target field specifies the field whose contents you want to replace. If no field is
specified and a field is selected in Browse mode or Find mode, that field is used.
<value or formula> is the calculation whose results will be inserted by this script step.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
The result of the calculation must match the field type. For example, you can't assign a date
calculation to a container field.
The specified field doesn’t have to be on the current layout.
If the result of the calculation doesn’t match the target field type, and the validate option for
the field is set to Always, the field will not be set and an error code is returned (which can
be captured with the Get(LastError) function).
When possible, the Set Field script step makes the record active and leaves it active until
the record is exited or committed. Scripts that use a series of Set Field script steps should
group these steps together if possible, so that subsequent Set Field script steps can act on
the record without having to lock the record, download and upload data, index the field, and
so on, after each individual Set Field script step. These functions and record level validation
are performed after the record has been exited or committed.
If the target field is a repeating field, you can specify a repetition number or generate a
repetition number from a calculated expression.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 76
Example 1
Inserts the sum of the invoices' grand totals into the Statistics field.
Set Field [Customers::Statistics; Sum ( Invoices::Grand Total )]
Example 2
Demonstrates when to use Set Field instead of Set Field By Name to simplify scripts.
#If the target field does not change, use the Set Field script step.
Set Field [Customers::Work Phone; Credit Collection::Phone Number]
#If you use Set Field by Name with a target field that does not change,
#you must surround the target field in quotation marks so it evaluates as
a literal string
#and returns the specified field name. If you do not use quotation marks,
#Set Field by Name evaluates the specified field and uses the result as
the target field.
#If the result does not specify a field name, nothing happens.
Set Field by Name ["Customers::Work Phone"; Credit Collection::Phone
Number]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 77
Set Field By Name
Purpose
Replaces the entire contents of a calculated target field in the current record with the calculated
value.
Format
Set Field by Name[<calculated target field>; <value or formula>]
Options
Specify target field is a calculation to specify the field whose contents you want to replace.
<value or formula> specifies the calculation whose results will be inserted by this script step.
Compatibility
Originated in
FileMaker Pro 10.0
Description
The Set Field By Name script step lets you create a calculation to specify a field name, then change
the value of the field either literally or based on a second calculation.
Because the target field is calculated, a single Set Field By Name step can replace multiple Set
Field script steps between If conditions.
The calculated target field must return a text result.
If quotation marks are not included around the fully qualified field name, the target field name is
obtained from the named field.
If no field is specified and a field is selected in Browse mode or Find mode, that field is used.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 78
Notes
The specified target field doesn’t have to be on the current layout.
Set Field By Name ignores validation checking.
When possible, the Set Field By Name script step makes the record active and leaves it
active until the record is exited or committed. Scripts that use a series of Set Field By Name
script steps should group these steps together if possible, so that subsequent Set Field By
Name script steps can act on the record without having to lock the record, download and
upload data, index the field, and so on, after each individual Set Field By Name script step.
These functions and record-level validation are performed after the record has been exited
or committed.
Example 1
Identifies the target field (National Statistics or World Statistics) based on geographical location,
then enters a calculated value (the sum of all Grand Totals) in the target field.
Set Field by Name [If ( Customers::Country = "Japan" ; Customers::National
Statistics ; Customers::World Statistics ); Sum ( Invoices::Grand Total )]
Example 2
Demonstrates when to use Set Field By Name instead of Set Field to simplify scripts.
#With Set Field, an If statement with multiple Else If steps is needed
#to determine which field on the Customers table to update
#with information from Credit Collection::Phone Number.
If [Credit Collection::Call Location = "Work"]
Set Field [Customers::Work Phone; Credit Collection::Phone Number]
Else If [Credit Collection::Call Location = "Home" ]
Set Field [Customers::Home Phone; Credit Collection::Phone Number]
Else If [Credit Collection::Call Location = "Mobile" ]
Set Field [Customers::Mobile Phone; Credit Collection::Phone Number]
End If
#A single Set Field by Name script step can perform the same task
#by using a calculation to determine the target field.
Set Field by Name [GetFieldName ( Evaluate ( Credit Collection::Call
Location & " Phone" ) ); Credit Collection::Phone Number]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 79
Set Next Serial Value
Purpose
Resets the next serial value in an auto-entry serial number field.
Format
Set Next Serial Value [<table::field>; <value or formula>]
Options
Specify target field specifies the serial number field on which the script step will operate.
The field you specify must be defined as an auto-entry serial number field.
Calculated result allows you to enter the next serial value or create a calculation to
determine the next serial value.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
You can define this script step to use any calculation expression to determine the next serial value of
a field that has been defined as an auto-entry serial number field. The calculation always evaluates
to a text result.
For example, you might want to reset the next serial value after you do one of the following:
import records into a FileMaker Pro database with an auto-entry serial number field
delete multiple serialized numbers from a FileMaker Pro database
Notes
This script step affects the definition of the field you specify instead of the actual contents of
the field that you specify.
This script step can operate on multiple files. If you specify a field in another file, then
FileMaker Pro attempts to update the serial number for the specified field in the other file. To
specify a field in another file, define a relationship to that file and use Specify target field to
select a field from that file.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 80
Example 1
Calculates the number of the next available invoice ID, using the Max function to return the highest
value in the Invoice ID field. If an invoice ID contains non-numeric data, then the calculation would
need to be more sophisticated to maintain the numeric and non-numeric data.
Go to Record/Request/Page [Last]
Set Next Serial Value [Invoices::Invoice ID; Max ( Invoices::Invoice ID )
+ 1]
Example 2
Sets the next serial number value in the Invoice ID field options after importing records. Useful if
Perform auto-enter options while importing is not selected in order to preserve dates and other
auto-entered values.
Import Records [Add; Mac Roman]
Set Next Serial Value [Invoices::Invoice ID; Get ( TotalRecordCount ) + 1]
Example 3
Prompts the user to input the next serial value.
Show Custom Dialog ["Set the next serial number value"; Invoices::Next
Serial Value]
If [Get ( LastMessageChoice ) = 1]
Set Next Serial Value [Invoices::Invoice ID; Invoices::Next Serial
Value]
End If
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 81
Insert Text
Purpose
Pastes a text value into a field in the current record.
Format
Insert Text [Select; <table::field>; “<text>”]
Options
Select entire contents replaces the contents of a field. If you do not select this option,
Insert Text inserts the specified value at the end of the field's data.
Go to target field specifies the field to receive the pasted information. If no field is selected,
the Insert Text command will place the specified text after the insertion point. If no field is
active at the time the command executes, it has no effect. Also, if the selected field is not
present on the current Layout, the Insert Text command has no effect.
<text> is the exact value you want to paste.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step pastes text that is specified in the script, instead of text provided by the user.
Notes
This script step is intended to paste text into text field types. To insert other types of data
into other types of fields, use either the Insert Calculated Result script step or the Set Field
script step.
If the specified field does not exist on the layout where the script is being performed, Insert
Text returns an error code which can be captured with the Get(LastError) function.
If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run
this script step in FileMaker WebDirect, use the Set Selection script step.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 82
Example 1
Inserts "Draft" into the Status field.
Insert Text [Select; Invoices::Status; "Draft"]
Example 2
Inserts either "Paid" or "Unpaid" depending on the value of the Payment Date field.
If [ IsEmpty ( Invoices::Payment Date )]
Insert Text [Select; Invoices::Status; "Unpaid"]
Else
Insert Text [Select; Invoices::Status; "Paid"]
End If
Example 3
Inserts "Draft" into the Status field or displays a dialog box if Status is not on the current layout.
Insert Text [Select; Invoices::Status; "Draft"]
If [Get ( LastError ) = 102]
Show Custom Dialog ["Status field is missing on current layout"]
End If
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 83
Insert Calculated Result
Purpose
Pastes the result of a calculation into the current field in the current record.
Format
Insert Calculated Result [Select; <table::field>; <value or formula>]
Options
Select entire contents replaces the contents of a field. If you don't select this option, Insert
Calculated Result replaces only the selected portion of the current field, or inserts the result
at the insertion point. The default insertion point is at the end of the field's data.
Go to target field specifies the field to paste the calculated results into. The target field
must be present on the layout to paste successfully. If no field is active when the script is
performed, the step has no effect.
<value or formula> is the calculation whose results will be inserted by this script step.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If the specified field does not exist on the layout where the script is being performed, Insert
Calculated Result returns an error code which can be captured with the Get(LastError) function.
Note If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run this script
step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Inserts the current date if the invoice prints successfully.
Set Error Capture [On]
Print [With dialog: On]
Insert Calculated Result [Select; Invoices::Print Status; If ( Get (
LastError ) = 0 ; "Printed on " & Get ( CurrentDate ) ; "Not Printed" )]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 84
Insert From Device
Purpose
In FileMaker Go, enters content from a device into a field.
Format
Insert from Device [<table::field>; Type: Music Library]
Insert from Device [<table::field>; Type: Photo Library]
Insert from Device [<table::field>; Type: Camera; Camera: Front/Back;
Resolution: Full/Small/Medium/Large]
Insert from Device [<table::field>; Type: Video Camera; Camera: Front/
Back; Resolution: Full/Small/Medium/Large; Max Duration: <value or
formula>; Start immediately]
Insert from Device [<table::field>; Type: Microphone; Max Duration: <value
or formula>; Start immediately]
Insert from Device [<table::field>; Type: Bar Code; Camera: Front/Back;
Resolution: Full/Small/Medium/Large; <table::field>]
Insert from Device [<table::field>; Type: Signature; Title: <value or
formula>; Message: <value or formula>; Prompt: <value or formula>]
Options
Specify target field specifies a container field. For bar codes, you can also specify a text
field. If no field is specified, the currently active field is used if it is a container field or text
field.
Insert from specifies the source type.
For Camera, choose Back or Front.
For Resolution, choose Full, Large, Medium, or Small.
Select Maximum duration to specify the number of seconds a video camera or
microphone records. Click Specify to define a duration from a calculation.
Select Start immediately to have a video camera or microphone start recording
immediately.
For Scan from Camera, choose Back or Front.
For Scan from Field, choose a field.
In the list of Bar code types, select the types of bar codes you want FileMaker Go to
scan. By default, all types are selected.
For Title, enter a title or a calculated value for the signature capture screen.
For Message, enter an informational message or a calculated value for the signature
capture screen.
For Prompt, enter a prompt or a calculated value to indicate the signature line. This
prompt replaces the default "Sign Here."
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 85
Compatibility
Originated in
FileMaker Pro 13.0
Description
This script step enters content into a container field from a music library, photo library, camera, video
camera, microphone, or signature; or enters content into a container field or text field from a bar
code source.
FileMaker Go does not support all types of bar codes.
If the target field is a repeating field, you can specify a repetition number or generate a
repetition number from a calculated expression.
If the target field is a text field, only the text value of the bar code is inserted into the field.
If the target field is a container field, an image of the bar code is inserted into the field. The
text value of the bar code is also stored in the field. You can retrieve the text value of the bar
code with the GetAsText function. You can retrieve the bar code type with the
GetContainerAttribute function.
Notes
In the script editing pane, the selected bar code types are not displayed. To see all settings,
print the script or use the Database Design Report (FileMaker Pro Advanced).
In the Bar Code Options dialog box, select:
EAN-13 to scan ISBN-10 or ISBN-13 bar codes. Also select ISBN-10 (from EAN-13) if
you need to convert a scanned ISBN-13 bar code to the ISBN-10 type.
EAN-13 as well as UPC-A or UPC-E to scan UPC-A or UPC-E bar codes.
Example 1
Inserts a photo taken by the iOS device’s back camera at Full resolution into the File Container field.
Insert from Device [Products::File Container; Type: Camera; Camera: Back;
Resolution: Full]
Where the script step runs Supported
FileMaker Pro No
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect No
Runtime solution No
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 86
Example 2
Inserts an image of a bar code taken by the iOS device’s back camera at Small resolution into the
container field named UPC. To retrieve the text value of the bar code, use GetAsText(UPC).
Insert from Device [Products::UPC; Type: Barcode; Camera: Back;
Resolution: Small]
Example 3
In the container field named Signature, displays a title, message, and prompt in the signature
capture screen.
Insert from Device [Invoice::Signature; Type: Signature; Title:
"Invoice"; Message: "Thank you for your order"; Prompt: "Signature
required"]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 87
Insert From Index
Purpose
Pastes a value from the index into a field.
Format
Insert from Index [Select; <table::field>]
Options
Select entire contents replaces the contents of a field. If you do not select this option,
Insert From Index inserts the result at the cursor position or at the end of the field's data.
Go to target field allows you to specify the field to paste the index value into. The field you
specify may be of any type.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step displays the index for the active field. You can use Insert From Index in Browse or
Find modes.
FileMaker Pro displays the View Index dialog box so the user can select an entry. This method
promotes consistent data entry and correct spelling. For this script step, you can specify a field and
select the entire contents of the field.
FileMaker Pro uses what was last selected for the Show individual words option in the View Index
dialog box (it is not remembered in the script).
Notes
If the specified field does not exist on the layout where the script is being performed, Insert
From Index returns an error code which can be captured with the Get(LastError) function.
If you have turned indexing off for a field and deselected the option to Automatically create
indexes as needed, the index will not display and an error code is returned. For more
information on field indexing see Defining field indexing options.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go No
Custom Web Publishing No
FileMaker WebDirect No
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 88
Example 1
Displays the index for a field in Find mode so the user can select a preexisting value.
Enter Find Mode [Pause: On]
Insert from Index [Customers::Company]
Perform Find [ ]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 89
Insert From Last Visited
Purpose
Pastes data from the last active record into the specified field in the current record or find request.
Format
Insert from Last Visited [Select; <table::field>]
Options
Select entire contents replaces the contents of a field. If you do not select this option,
Insert From Last Visited inserts the result at the insertion point or at the end of the field's
existing data.
Go to target field specifies the field to paste into.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Use this script step to ensure consistency and automate data entry. The active record is the last
record where FileMaker Pro performed some activity, such as pasting text or moving into a field with
the Go to Field script step.
Notes
If the specified field does not exist on the layout where the script is being performed, Insert
From Last Visited returns an error code which can be captured with the Get(LastError)
function.
If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run
this script step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Creates a new record and inserts the customer name from the last record that was viewed.
New Record/Request
Insert from Last Visited [Invoices::Customer Name]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 90
Example 2
Inserts the value from the Customer Name field of the last visited record into a find request, pauses
for the user to make modifications, then performs the find.
Enter Find Mode [Pause: Off]
Insert from Last Visited [Invoices::Customer Name]
Pause/Resume Script [Indefinitely]
Perform Find [ ]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 91
Insert From URL
Purpose
Enters the content from a URL into a field.
Format
Insert from URL [Verify SSL Certificates; Select; With dialog: On/Off;
<table::field>; <resource URL>]
Options
Verify SSL Certificates verifies the SSL certificate of the server specified in the URL. If the
certificate cannot be verified, users can choose to connect anyway or cancel to skip this
script step. If the certificate cannot be verified and the Set Error Capture script step is set to
On, Insert From URL behaves as if the server were unavailable.
Select entire contents replaces the contents of a field. If you do not select this option,
Insert From URL inserts the content from the URL at the insertion point or at the end of the
field's data.
With dialog specifies whether to display the “Insert from URL” Options dialog box when the
script step is performed.
Go to target field specifies the field to insert the URL content into.
Specify URL allows you to type the URL or to create your URL from a calculation.
Automatically encode URL replaces special characters with the corresponding encoded
values required for URLs. For example, a space character is replaced with %20. When this
option is deselected, the URL remains as it is entered.
Compatibility
Originated in
FileMaker Pro 12.0
Description
Insert From URL supports http, https, httppost, httpspost, ftp, ftps, and file protocols. FileMaker Pro
downloads the resource that is specified by the URL to the target field.
For a list of picture and audio/video formats supported in container fields, see Using data in
container fields.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 92
Important For better performance in FileMaker WebDirect, be sure that Select entire contents is
selected.
Notes
Insert From URL supports UTF-8 only.
In FileMaker WebDirect:
If the With dialog option is On, this script step runs as if Automatically encode URL is
selected.
If Select entire contents is deselected, and Insert From URL inserts content into a text
field, the contents from the URL are appended to the text field. Multiple fetches can
result in unpredictable results and slower performance.
httppost and httpspost are custom schemes defined by FileMaker Pro that enable you to
send HTTP POST data. See About importing data using an HTTP request.
If the specified field doesn’t exist on the layout where the script is being performed, Insert
From URL returns an error code, which can be captured with the Get(LastError) function.
Example 1
Accesses a website and inserts a PDF into the Sales Report container field.
Insert from URL [With dialog: Off; Customers::Sales Report; “http://
www.filemaker.com/sales_report.pdf”]
Example 2
Inserts a map showing the customer's address in the Address Map container field.
Insert from URL [With dialog: Off; Customers::Address Map; "http://
maps.google.com/maps/api/staticmap?center=" & Customers::Address &
"&zoom=14&markers=" & Customers::Address & "&size=256x256&sensor=false"]
Example 3
Inserts the HTML code for http://www.apple.com.
Insert from URL [With dialog: Off; Customers::HTML Website Code; "http://
www.apple.com"]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 93
Insert Current Date
Purpose
Pastes the current system date into the specified field.
Format
Insert Current Date [Select; <table::field>]
Options
Select entire contents replaces the contents of a field with the current date. If you do not
select this option, Insert Current Date adds the value of the current date to the end of the
field's existing data.
Go to target field specifies the field to paste the date into.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
To perform a calculation with the current date, make sure the receiving field is defined as a
date field.
If the specified field does not exist on the layout where the script is being performed, Insert
Current Date returns an error code which can be captured with the Get(LastError) function.
If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run
this script step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Goes to the Email History layout, inserts the current date in the Last Sent field, then goes to the
original layout.
Go to Layout ["Email History"]
Insert Current Date [Select; Emails::Last Sent]
Go to Layout [original layout]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 94
Insert Current Time
Purpose
Pastes the current system time into the specified field.
Format
Insert Current Time [Select; <table::field>]
Options
Select entire contents replaces the contents of a field with the current time. If you do not
select this option, Insert Current Time adds the value of the current time to the end of the
field's existing data.
Go to target field specifies the field to paste into.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
To perform a calculation with the current time, make sure the receiving field is defined as a
Time field.
If the specified field does not exist on the layout where the script is being performed, Insert
Current Time returns an error code which can be captured with the Get(LastError) function.
If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run
this script step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Goes to the Email History layout, inserts the current time in the Last Sent field, then goes to the
original layout.
Go to Layout ["Email History"]
Insert Current Time [Select; Emails::Last Sent]
Go to Layout [original layout]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 95
Insert Current User Name
Purpose
Pastes the current user name into the specified field in the current record.
Format
Insert Current User Name [Select; <table::field>]
Options
Select entire contents replaces the contents of a field with the current user name. If you do
not select this option, Insert Current User Name adds the value of the current user name to
the end of the field's existing data.
Go to target field specifies the field to paste into.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If the specified field does not exist on the layout where the script is being performed, Insert
Current User Name returns an error code which can be captured with the Get(LastError)
function.
User name is the FileMaker Pro user, an editable field displayed on the General tab of the
Preferences dialog box. To track user access to a database with more security, use the
Get(AccountName) function to return the current user’s account name.
In FileMaker WebDirect, Insert Current User Name pastes the current user’s account name,
not the current user name.
If you manually select field data before you run this script step in FileMaker WebDirect, the
script step performs as if you did not make a selection. To select field data before you run
this script step in FileMaker WebDirect, use the Set Selection script step.
Example 1
Goes to the Email History layout, inserts the current user name in the Sent by field, then goes to the
original layout.
Go to Layout ["Email History"]
Insert Current User Name [Select; Emails::Sent by]
Go to Layout [original layout]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 96
Insert Picture
Purpose
Imports a graphic from another file into the current container field.
Format
Insert Picture [Reference;“<filename>”]
Options
Store only as a reference instructs FileMaker Pro to store only a link to the graphic file
instead of the entire file. This option may reduce the size of your FileMaker Pro file, but if
you move or delete the graphic, FileMaker Pro will be unable to display it.
Specify source file identifies the file that contains the graphic. The file path must begin with
image, imagemac, or imagewin. See Creating file paths.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
You must specify a field, click in a field, or use the Go to Field script step before performing this
script step.
When Insert Picture is performed, unless a file is specified with the Specify source file option,
FileMaker Pro displays a dialog box where the user can select and preview the file to be imported.
Notes
FileMaker WebDirect does not support the Store only as a reference or Specify source
file options.
If there is no active container field on the layout where the script is being performed, Insert
Picture returns an error code that can be captured with the Get(LastError) function.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect Partial
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 97
Example 1
Goes to the Picture field and inserts a picture.
Go to Field [Products::Picture]
Insert Picture ["Mobile Phone.png"]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 98
Insert Audio/Video
Purpose
Imports an audio or video file, or a file reference, into the current interactive container.
Format
Insert Audio/Video [Reference;“<filename>”]
Options
Store only as reference instructs FileMaker Pro to store only a link to an audio or video file
in the container field instead of the actual file. This option may reduce the size of your
FileMaker Pro file, but if you move or delete the file being referenced, FileMaker Pro won't
be able to display it.
Specify source file specifies the audio or video file you intend to insert in the interactive
container. The file path must begin with movie, moviemac, or moviewin. See Creating file
paths.
Compatibility
Originated in
FileMaker Pro 12.0
Description
You must specify a field, click in a field, or use the Go to Field script step before performing this
script step.
When Insert Audio/Video is performed, unless a file is specified with the Specify source file option,
FileMaker Pro displays a dialog box where the user can select and preview the file to be imported.
Note FileMaker WebDirect does not support the Store only as reference or Specify source file
options.
Notes
If there is no active container field on the layout where the script is being performed, Insert
Audio/Video returns an error code that can be captured with the Get(LastError) function.
This script step works only for interactive containers. For more information, see Specifying
formats for container fields.
For a list of supported media types, see Using data in container fields.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect Partial
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 99
Example 1
Goes to the Media field and inserts an audio file.
Go to Field [Customers::Media]
Insert Audio/Video [“Music.mp3”]
Example 2
Inserts the media file specified in the Media Name field into the active container field by reference.
Set Variable [$MEDIA_PATH; Value: Get ( DocumentsPath ) & Products::Media
Name]
Insert Audio/Video [Reference; “$MEDIA_PATH”]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 100
Insert PDF
Purpose
Imports a PDF file or file reference into the current interactive container.
Format
Insert PDF [Reference;“<filename>”]
Options
Store only as reference instructs FileMaker Pro to store a link to a PDF file in the container
field instead of the actual file. This option may reduce the size of your FileMaker Pro file, but
if you move or delete the file being referenced, FileMaker Pro won't be able to display it.
Specify source file allows you to specify the PDF file you intend to insert in the interactive
container. The file path must begin with image, imagemac, or imagewin. See Creating file
paths.
Compatibility
Originated in
FileMaker Pro 12.0
Description
You must specify a field, click in a field, or use the Go to Field script step before performing this
script step.
When Insert PDF is performed, unless a file is specified with the Specify source file option,
FileMaker Pro displays a dialog box where the user can select and preview the file to be imported.
Notes
FileMaker WebDirect does not support the Store only as reference or Specify source file
options.
If there is no active container field on the layout where the script is being performed, Insert
PDF returns an error code that can be captured with the Get(LastError) function.
This script step works only with interactive containers. For more information, see Specifying
formats for container fields.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect Partial
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 101
Example 1
Goes to the File field and inserts a PDF.
Go to Field [Products::File]
Insert PDF [“Product Description.pdf”]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 102
Insert File
Purpose
Imports a file or file reference into the current container field; configures the Insert File dialog box.
Format
Insert File [<dialog options>;<table::field>;”<filename>”]
Options
Dialog options allows you to create a custom Insert File dialog box, filter file types, and
choose storage, display, and compression options for files that are inserted into a container
field. See Insert File Options dialog box.
Go to target field specifies the container field to insert the file into.
Specify source file specifies the file to be inserted. For information on creating file paths in
FileMaker Pro, see Creating file paths.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
You must specify a target field, click in a field, or use the Go to Field script step before performing
this script step. If you do not specify a file to insert, FileMaker Pro displays a dialog box where the
user can select a file.
Notes
If there is no active container field on the layout where the script is being performed, Insert
File returns an error code that can be captured with the Get(LastError) function.
FileMaker WebDirect does not support the Dialog options or Specify source file options.
FileMaker Go uses the following options in the Insert File Options dialog box with this script
step: for Storage options, it uses Insert; and for Display, it uses Content of file (when
possible).
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Partial
Custom Web Publishing No
FileMaker WebDirect Partial
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 103
Example 1
Goes to the File field and inserts a document.
Go to Field [Products::File]
Insert File ["Instruction Manual.doc"]
Example 2
Opens a dialog box with custom file format filters for the user to select a file, attempts to compress
the selected file, then inserts the file into the active container field.
Insert File [Filters; Insert; Compress when possible]
Example 3
Inserts the file specified in the File Name field into the File container field, and attempts to display
the contents of the file.
Set Variable [$FILE_PATH; Value: Get ( DocumentsPath ) & Products::File
Name]
Insert File [Insert; Display content; Never compress; Products::File ;
$FILE_PATH]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 104
Replace Field Contents
Purpose
Replaces the value in a field in every record in the found set with a different value.
Format
Replace Field Contents [With dialog: On/Off; <table::field>;
Current contents/Serial numbers/Calculation results]
Options
With dialog specifies whether to display the Replace Field Contents dialog box when the
script step is performed.
Specify target field specifies the target field for the replace operation.
Replace with "current contents" uses the current value in the specified field as the
replacement value to place in that field in every other record in the current found set.
Replace with serial numbers reserializes the field in every record in the current found set.
Entry options uses the next available value in Entry Options as the first record number,
incrementing with whatever value is in Entry Options.
Custom Values lets you enter a value to be used as a starting point for the
serialization, as well as a value by which to increment each serialized field in the current
found set.
Update serial number in Entry Options? resets the serial number value in Entry
Options so that the next serial number that is automatically entered will follow the
records you have reserialized with this script step. If this option is not used, the serial
value in Entry Options is not changed, and may not be in sequence with the newly
reserialized records.
If the field to be replaced was set up for auto-entry of a serial number and Prohibit
modification of value is not selected, FileMaker Pro will still put sequential numbers in the
selected field, but will do so starting with the next number to be automatically entered.
Replace with calculated result displays the Specify Calculation dialog box, where you can
enter a calculation to be used as the replacement value.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Partial
Custom Web Publishing Partial
FileMaker WebDirect Partial
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 105
Description
This script step uses the value in a specified field in the current record or uses a calculation to
replace the value in that field in every record in the current found set.
Important Replace Field Contents modifies all records in the found set. You cannot undo a Replace
Field Contents script step.
This script step can also be used to reserialize a field in every record in the current found
set.
When you use the Replace Field Contents script step, the data must be committed first
before the operation is performed, or you may get unexpected results. See Committing data
in records.
FileMaker WebDirect, server-side scripts, and Custom Web Publishing run this script step
as if the With dialog option is set to Off.
FileMaker Go does not support the With dialog: On option.
Example 1
Assigns serial numbers to all invoices in the found set.
Sort Records [Restore; With dialog: On]
Go to Record/Request/Page [First]
Replace Field Contents [With dialog: Off; Invoices::Invoice ID; Serial
numbers]
Example 2
Replaces the contents of the Customer ID field in all records in the found set with the contents of the
current record's Customer ID field.
Perform Find [Restore]
Replace Field Contents [With dialog: Off; Invoices::Customer ID; Current
Contents]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 106
Relookup Field Contents
Purpose
Copies new values from the lookup source field into the current found set.
Format
Relookup Field Contents [With dialog: On/Off; <table::field>]
Options
With dialog specifies whether to display a dialog box when the script step is performed,
allowing users to confirm field information.
Go to target field specifies the field that is the target of the relookup operation.
FileMaker Pro moves the cursor to the field you specify. This must be the match field for the
relationship upon which the lookup is based, not the lookup source field or lookup target
field. If no field is selected, Relookup Field Contents returns an error code that can be
captured with the Get(LastError) function.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
The target field specified for the Relookup Field Contents step must be an editable field.
Relookups are only performed on the found set of records in the active table.
Calculation fields cannot be used for the Relookup Field Contents command. If you use the
Relookup Field Contents command, and you're using a calculation field as the matching
value, you must specify one of the input fields for the calculation as the field parameter for
the Relookup Field Contents.
When you use the Relookup Field Contents script step, the data must be committed first
before the operation is performed, or you may get unexpected results. See Committing data
in records.
Server-side scripts and Custom Web Publishing run this script step as if the With dialog
option is set to Off.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 107
Example 1
Finds records that have matching values in the Customer ID field, then updates all lookups in the
found set based on the relationship that uses Customer ID as a match field.
Go to Layout [“Invoice Details"]
Find Matching Records [Replace; Invoices::Customer ID]
Relookup Field Contents [With dialog: Off; Invoices::Customer ID]
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 108
Export Field Contents
Purpose
Exports the contents of a single field in the active record to a new file.
Format
Export Field Contents [<table::field>; “<filename>”; Automatically open;
Create email]
Options
Specify target field specifies the field to be exported. If no field is specified, FileMaker Pro
will export the contents of the current field in the active table.
Specify output file specifies the name and location of the file to which the field contents will
be exported. For more information, see Creating file paths. If no file is specified, the user is
asked to choose a filename and location when the script step is performed. You can choose
to Automatically open file or Create email with file as attachment after saving.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
If the contents of the exported field is text, then FileMaker creates a UTF-16 format text file.
Notes
FileMaker WebDirect does not support the Specify output file option. FileMaker WebDirect
exports field contents to the web browser’s default download location.
FileMaker WebDirect does not support this script step in mobile browsers.
FileMaker Go export text as a UTF-8 format text file.
Example 1
Opens a dialog box to set the export path and filename, then exports the image.
Export Field Contents [Products::Picture; ”Mobile Phone.png”]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server No
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect Partial
Runtime solution Yes
Fields script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 109
Example 2
Exports files from the Container field in all the records in the found set to a set file path.
Set Variable [$PATH; Value: Get ( DocumentsPath ) & Products::Container]
Go to Record/Request/Page [First]
Loop
Export Field Contents [Products::Container; "$PATH"]
Go to Record/Request/Page [Next; Exit after last]
End Loop
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 110
Records script steps
Records script steps affect specific records and find requests. Use these script steps to:
add, delete, and copy records or find requests
change field contents in all records in the found set
commit and revert records
import and export records
save records to various formats
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 111
New Record/Request
Purpose
Creates a new, blank record or a new find request.
Format
New Record/Request
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
In Browse mode, this script step creates a new, blank record. In Find mode, it creates a new find
request.
Example 1
Goes to the Invoice Details layout, creates a record, and goes to the Summary field.
Go to Layout [“Invoice Details”]
New Record/Request
Go to Field [Invoices::Summary]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 112
Duplicate Record/Request
Purpose
Duplicates the current record or the current find request.
Format
Duplicate Record/Request
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
In Browse mode, this script step makes a duplicate of the current record. In Find mode, it duplicates
the current find request.
If the record has a field set up for automatic entry of values, this script step does not duplicate the
value in the field of the current record. In that case, FileMaker Pro generates and enters a new value
for the duplicated record.
To use the Duplicate Record/Request script step with portal rows, first use the Go to Portal Row
script step, and then use the Duplicate Record/Request step. Using the Duplicate Record/Request
step when a portal row is selected will duplicate the selected row in the related table. This option is
only available when the option to allow creation of related records has been enabled for the
relationship.
Example 1
Performs a find, goes to the last record, and duplicates the record.
Perform Find [Restore]
Go to Record/Request/Page [Last]
Duplicate Record/Request
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 113
Delete Record/Request
Purpose
Deletes the current record or find request.
Format
Delete Record/Request [With dialog: On/Off]
Options
With dialog specifies whether to display a dialog box when the script step is performed, asking
users to confirm deletion of the record or request.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
In Browse mode, this script step deletes the current record. In Find mode, it deletes the current find
request.
To delete Do this
A master record Make sure that the record you want to delete is active (use navigation script steps),
and then use Delete Record/Request. If the current layout contains a portal, click
anywhere on the record outside of the portal to make sure that no related record is
selected, then use Delete Record/Request.
A related record Perform Delete Record/Request in a portal row, or use the Delete Portal Row script
step.
A find request Make sure that the find request you want to delete is active (use navigation script
steps), and then use Delete Record/Request.
Important You cannot undo a Delete Record/Request script step.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 114
Example 1
Goes to a related record and asks if the user wants to delete it.
Go to Related Record [From table: "Products"; Using layout: “Product
Details”]
Delete Record/Request [With dialog: On]
Example 2
Displays a custom dialog box to ask if the user wants to delete the current product.
Show Custom Dialog ["Do you want to delete " & Products::Name & "?"]
If [Get ( LastMessageChoice ) = 1]
Delete Record/Request [With dialog: Off]
End If
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 115
Delete Portal Row
Purpose
Deletes the selected portal row (which deletes data in a related record).ts
Format
Delete Portal Row [With dialog: On/Off]
Options
With dialog specifies whether to display a dialog box when the script step is performed, asking
users to confirm deletion of the portal row.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Use the Go to Portal Row script step to control which row is selected. (If no portal row is selected,
nothing happens when this script step executes.)
Note After you use a Delete Portal Row script step in FileMaker WebDirect, click anywhere on the
layout or use a Commit Records/Requests script step to commit the deletion.
Important You cannot undo a Delete Portal Row script step.
Example 1
Asks if the user wants to delete the portal row if a product is discontinued.
If [Products::Availability = "Discontinued"]
Delete Portal Row [With dialog: On]
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Partial
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 116
Example 2
Asks if the user wants to delete the product in the current portal row.
Show Custom Dialog ["Do you want to delete " & Products::Name & "?"]
If [Get ( LastMessageChoice ) = 1]
Delete Portal Row [With dialog: Off]
End If
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 117
Delete All Records
Purpose
Deletes all the records in the current found set.
Format
Delete All Records [With dialog: On/Off]
Options
With dialog specifies whether to display a dialog box when the script step is performed, asking
users to confirm deletion of all records.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Important You cannot undo deleting records.
Delete All Records attempts to lock a group of records in the found set before deleting them. If it can
lock all records in the group, this script step deletes the group of records, attempts to lock the next
group of records, and so on. The first time it can’t lock all records in a group (for example, if a record
is being edited by another user), Delete All Records stops and returns an error code (which can be
captured with the Get(LastError) function).
Notes
To delete all records in the current table, use the Show All Records script step, then use
Delete All Records.
Example 1
Asks if the user wants to delete all records in the current table.
Show All Records
Delete All Records [With dialog: On]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 118
Example 2
Asks if the user wants to delete all records in the current found set.
Show Custom Dialog ["Do you want to delete all " & Get ( FoundCount ) & "
records found?"]
If [Get ( LastMessageChoice ) = 1]
Delete All Records [With dialog: Off]
End If
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 119
Open Record/Request
Purpose
Makes an existing record or find request available for editing if the current user has record-editing
privileges.
Format
Open Record/Request
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step makes an existing record available (in Browse mode) or an existing find request
available (in Find mode) for editing if the current user has record-editing privileges. When performed
on a record, this script step verifies that the user has sufficient access privileges to edit the record. If
the user has the proper privilege set, FileMaker Pro attempts to prevent others from simultaneously
editing or deleting the record. Once locked, the record is considered “opened” and may be edited.
If an error occurs (for example, if the current user has insufficient access privileges, the record is
currently locked by another user, or the record is open in another window), FileMaker Pro generates
an error message, which may be captured using the Set Error Capture script step and the
Get(LastError) function. (Opening a find request will not return an error, because requests can’t be
locked by other users.)
Important Because any attempt to modify a field or a record will also attempt to open the record for
editing, in most cases you will not need to use the Open Record/Request script step to open a
record explicitly. But when using the Go to Record/Request/Page script step to enter a field or
record, use the Open Record/Request script step first to obtain a write lock.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing Yes
FileMaker WebDirect Yes
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 120
Example 1
Prints the current invoice if the user has the privileges to edit it.
Go to Layout ["Print Invoices"]
Open Record/Request
If [Get ( LastError ) = 0]
Print [With dialog: On]
End If
Go to Layout [original layout]
Example 2
Checks if the current user account has the privilege to edit records. If not, asks if the user wants to
log in to a different account.
Note This script does not run properly if it is set to run with full access privileges because this
allows any account to open the record.
Set Error Capture [On]
Go to Layout ["Invoice Details"]
Open Record/Request
If [Get ( LastError ) = 200]
Show Custom Dialog ["You cannot edit this record. Do you want to re-
login?"]
If [Get ( LastMessageChoice ) = 1]
Re-Login [With dialog: On]
Else
Go to Layout [original layout]
End If
End If
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 121
Revert Record/Request
Purpose
Returns the current record or find request to the way it was before editing began.
Format
Revert Record/Request [With dialog: On/Off]
Options
With dialog displays a dialog box when the script step is performed, asking users to confirm the
revert action.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Example 1
Displays a dialog box if the current record has been modified but not committed. Gives the user the
option of reverting the record.
If [Get ( RecordOpenState ) = 2]
Show Custom Dialog ["This record has been modified since it was last
entered."]
#Button 1 is Commit. Button 2 is Revert.
If [Get ( LastMessageChoice ) = 2]
Revert Record/Request [With dialog: Off]
End If
End If
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 122
Commit Records/Requests
Purpose
Commits a record or find request.
Format
Commit Records/Requests [Skip data entry validation; With dialog: On/Off;
Force Commit]
Options
Skip data entry validation overrides any data entry validation options set for fields and
commits the record anyway. This option only skips validation for fields set with the Only
during data entry validation option in the Options for Field dialog box; fields set to Always
validate will still validate, even if the Skip data entry validation option is selected. See
Defining field validation.
With dialog specifies whether to display a dialog box when the script step is performed,
asking users to confirm the commit action.
Note Setting With dialog to Off only applies when Save record changes automatically is
cleared in the Layout preferences.
Override ESS locking conflicts allows clients of ODBC data sources to force-commit
changes when optimistic locking otherwise prevents the commit action. ODBC data sources
are also referred to as external SQL sources (ESS).
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
This script step exits the current record or find request, updating field data and making no field active.
Example 1
Goes to the Invoice Details layout, inserts the current date into the Date field, and commits the
record.
Go to Layout ["Invoice Details"]
Insert Calculated Result [Invoices::Date; Get ( CurrentDate )]
Commit Records/Requests [With dialog: Off]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Yes
Custom Web Publishing Partial
FileMaker WebDirect Yes
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 123
Copy Record/Request
Purpose
Copies the values of a record or find request to the Clipboard.
Format
Copy Record/Request
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
Text fields are copied in tab-delimited format, without styles, in the order they appear in the record
layout. Text in container fields is also copied. (This script step is equivalent to choosing Copy from
the Edit menu when there is no active field.)
Notes
Contents that you cut or copy to the Clipboard are accessible to other applications.
When using the Copy Record/Request step with repeating fields, FileMaker Pro inserts the
group separator character between each repetition. You can use a text editor to replace
these characters with another delimiter such as a tab or space.
Any fields located in popovers are ignored when you copy records.
Example 1
Copies the contents of the current record and displays a custom dialog box.
Copy Record/Request
Show Custom Dialog ["You can now paste the current record in your
spreadsheet software."]
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect No
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 124
Copy All Records/Requests
Purpose
Copies the values of all records or the search criteria in all find requests to the Clipboard.
Format
Copy All Records/Requests
Options
None.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
In Browse mode, this script step copies the values of all records to the Clipboard. In Find mode, it
copies all find requests to the Clipboard.
Text fields are copied in tab-delimited format, without styles, in the order they appear in the record
layout. Text in container fields is also copied. (This script step is equivalent to choosing Copy from
the Edit menu while holding down the Shift key (Windows) or Option key (OS X) when there is no
active field.)
Notes
Contents that you cut or copy to the Clipboard are accessible to other applications.
When using the Copy All Records/Requests step with repeating fields, FileMaker Pro
inserts the group separator character between each repetition. You can use a text editor to
replace these characters with another delimiter such as a tab or space.
Any fields located in popovers are ignored when you copy records.
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Yes
FileMaker Go Yes
Custom Web Publishing No
FileMaker WebDirect No
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 125
Example 1
Finds all records with the same Customer ID as the current record, sorts, copies the contents of all
the records in the found set, and displays a dialog box.
Find Matching Records [Replace; Invoices::Customer ID]
Sort Records [Restore; With dialog: Off]
Copy All Records/Requests
Show Custom Dialog ["You can now paste data from the current " & Get (
FoundCount ) & " invoices."]
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 126
Import Records
Purpose
Imports records from a specified file or data source.
Format
Import Records [Verify SSL Certificates; With dialog: On/Off; “<source or
filename>”; Add/Update existing/Update matching; <platform and character
set>]
Options
Verify SSL Certificates verifies the SSL certificate of the server specified in an HTTP
request for XML data. If the certificate cannot be verified, users can choose to connect
anyway or cancel to skip this script step. If the certificate cannot be verified and the Set
Error Capture script step is set to On, this script step behaves as if the server were
unavailable.
With dialog specifies whether to display import-related dialog boxes when the script step is
performed. However, if a data source file has not been specified, the Open File dialog box is
displayed when a script is run.
Specify data source specifies the file or source of the data to be imported. Depending on
the file or source you choose, a dialog box may appear for specifying the following
additional options:
When you
choose this file
or source Do this
File In the Specify File dialog box, choose the file you want to import, or type file paths
directly into the list. Specify one path per line. FileMaker Pro will use the first path
it locates as the file to import. See Creating file paths.
Folder In the Folder of Files Import Options dialog box, choose the folder of image or
text files that you want to import, or type the folder paths directly into the list.
Specify one path per line. FileMaker Pro will use the first path it locates as the
folder to import. For more information, see Importing a folder of files all at once
and Creating file paths. This option is not supported from scripts running on
FileMaker Server.
XML Data In the Specify XML and XSL Options dialog box, choose the source of the XML
data that you want to import, and choose an XSLT style sheet if you want to apply
one prior to import. The XML and XSLT source may be a file or the result of an
HTTP request, or a calculation that generates a file path or an HTTP request. For
more information, see Importing XML data.
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 127
Specify import order tells FileMaker Pro to use a predefined import order. The last import
order used in the file appears as the default and can be edited. This option also lets you
choose whether to keep repeating field data together or to split repeating fields into
separate records, as well as whether to add new records, replace data in the current found
set, or import data as a new table.
Note When import source fields and target fields are mapped using matching names, field
name matching is performed dynamically each time the script step is performed.
Compatibility
Originated in
FileMaker Pro 6.0 or earlier
Description
You can set the import order and use the Specify import order option, or perform this script step
with the dialog box so the user can set new criteria, such as importing data as a new table.
If the source file is open, the found set is imported; if not, all records in the source table are
imported.
If you include this script step in a server-side script and you do not set With dialog to Off, the text
(NOT compatible) appears after the script step. The script, however, will run. The behavior will be
the same as if With dialog is Off. See Get(DocumentsPathListing) function for more information.
If you run a server-side script to do any of the following, you will receive an error:
importing records to new table
importing records from a folder
importing images to a container field
ODBC Data Specify the data source name and location, the user ID and password (if any),
and the SQL query to be executed. You can enter a query directly or specify a
calculation to generate the query. For more information, see Automating ODBC
import using the Import Records script step.
SQL statements are limited to a maximum length of 256 K characters (512 KB).
Note If you use the Import Records script step to import ODBC data that
contains Unicode strings, your ODBC driver must support Unicode. Otherwise,
the results may be inconsistent.
When you
choose this file
or source Do this
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server Partial
FileMaker Go Partial
Custom Web Publishing No
FileMaker WebDirect Partial
Runtime solution Yes
Records script steps
FILEMAKER PRO SCRIPT STEPS REFERENCE 128
Notes
When using the Import Records script step or Export Records script step in a server-side
script, keep the following in mind:
Any specified file must be in the FileMaker Server Documents folder, the temporary
folder, or a child folder of either the FileMaker Server Documents folder or the
temporary folder. For example, the following are all valid paths for file.csv:
<Documents>/file.csv
<Temporary Path>/file.csv
<Documents>/Folder1/file.csv
<Temporary Path>/Folder1/Folder2/Folder3/Folder4/file.csv
Any path specified that isn’t a complete path to the file (for example, anything other than
/Macintosh HD/Library/FileMaker Server/Data/Documents/<0 or more directories>/
<filename> ) is evaluated as being relative to the temporary path.
Any paths that include “..” are considered invalid.
For FileMaker Pro, if an absolute path is not specified in a script that will be executed from
FileMaker Pro, the path is assumed to be relative to the location of the database file from
which the script was run. For example, if a script containing the Export Records script step
is run with the pathname file:/export.tab, and the file running the script is /MyFiles/
Library/Books.fmp12, the exported file will be created as /MyFiles/Library/export.tab.
Support for importing photos from a digital camera or device has been removed from
FileMaker Pro.
If a script created in an earlier version of FileMaker Pro contains an Import Records
[Digital Camera] script step, the step is commented as obsolete. You can remove the
step, but you can’t edit it.
If a button references an Import Records [Digital Camera] script step, the button is
disabled and the Import Records script step is commented as obsolete in the Button
Setup dialog box.
FileMaker Go only supports importing from one FileMaker Pro file to another FileMaker Pro
file.
FileMaker Go does not support importing to a new table.
When using this script step in FileMaker WebDirect, keep the following in mind:
FileMaker WebDirect does not support this