Script Steps Reference

Table Of Contents
148 FileMaker Script Steps Reference
For calculated scripts and scripts stored in FileMaker Pro fields, the AppleScript
commands are compiled each time the script is performed. If you type the script into the
Native AppleScript text area, then FileMaker Pro compiles the script and detects any
scripting or system errors. (The script is recompiled whenever it's edited.)
Note Because AppleScript is a Mac OS feature, if you run a script containing a Perform
AppleScript script step on a Windows computer, the script step is ignored. (An error code
is generated, which can be captured with the Get(LastError) function.)
Tips on usage
FileMaker Pro can use the Perform AppleScript script step to send Apple events to
itself or to FileMaker Pro software running on other machines.
If you are using FileMaker Pro for Mac OS and you performed a complete installation,
see the FileMaker Pro Apple Events Reference database (located in the
FileMaker Pro\English Extras\Apple Events folder) for additional information and
examples.
Use Perform AppleScript to communicate with applets and other scriptable
applications. For example, if you have created an AppleScript applet with sub-
routines, you can call the handlers using the Perform AppleScript command, like this:
Perform AppleScript ["tell application "My Applet" to
doMyRoutine()"]
Examples
This example copies text from a field in a FileMaker Pro database and pastes it into a new
AppleWorks word processing document.
Copy [Select; Correspondence::Letter]
Perform AppleScript ["Tell Application "AppleWorks 6" activate
make new document paste end tell"]
This example sets the primary monitor to its minimum bit depth.
Perform AppleScript ["tell application "Finder" to set bounds
of window "My Files" to {100,100,100,100}”]
Execute SQL
Format
Execute SQL [No Dialog; ODBC: <datasource name>; <native SQL
or calculated SQL>]
Options
Perform without dialog prevents the Specify SQL dialog box, the Select ODBC Data
Source dialog box, and the Password dialog box from displaying when the script step
executes.