Chapter 13. Scripting Basics

Calculation fields let you tell FileMaker how to automatically update and validate the data in your database. But working with the database is still a manual affair. If you often need to print a summarized report, you have to perform a find, sort the records, switch layouts, print, and then switch back to the original layout manually. Once you’ve done it 27 times, you start wishing you could click a button and have the report print itself. Well, you can: Just tell FileMaker the same series of steps you’ve been doing over and over again, and attach the list to a button (Section 6.6.5.3). That’s the essence of scripting.

A script is a series of steps bundled together. When you run the script (by clicking a button, say), FileMaker carries out all the steps on your behalf, one after the other. Scripts can be simple—just the five steps necessary to print the report—or they can be much more complicated. Advanced scripts can even incorporate calculations (Chapter 9) to do different things in different situations by making simple decisions based on the data in your database, the current time or date, and so on.

Note

If you’ve worked with other scripting environments—like Visual Basic for Applications, AppleScript, or JavaScript—FileMaker’s script-building tools are pleasantly familiar.

Your First Script

To get a feel for how scripting works, you’ll create a really simple script. Suppose you want to find all invoices with a balance due and view them in a sorted list. ...

Get FileMaker Pro 8: The Missing Manual now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.