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 (Running Scripts). 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 same five steps you’d go through if you printed a report manually. Or they can be much more complicated—and can handle tricky or tedious tasks you wouldn’t want to do manually. Advanced scripts can even incorporate calculations (Part IV) to do different things in different situations by making simple decisions based on the data in your database, the current time or date, or any other condition you want to test.

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.

Get FileMaker Pro 9: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.