Working with Files

The Files section in the Script Step list contains some of the least often used script steps in all of FileMaker. But if you work in a school, say, the day may come when you need to automate the process of formatting files or saving backup copies for every student in a class. You can also script the process of converting older databases to FileMaker .fp7 format and recovering damaged databases, but these are sensitive processes that are better handled manually.

Opening and Closing Files

The Open File script step lets you open another FileMaker file. You can pick any of your existing file references (see Adding a Table Occurrence from Another File) or create a new file reference if necessary. When the step runs, the specified file opens and appears in a new window. If the file has a script set to run when it opens, it runs.

If you want the file to open, but you don’t want to see a window on the screen, turn on the “Open hidden” option for this step. The file opens, but it’s listed in the Show Window submenu of the Window menu, with its name in parentheses.

The Close File script step closes any open file. When you add the step, you get to pick any file reference or add a new one. You can also choose Current File to close the file the script is in. If the file is open when the script runs, all its windows close and its closing script runs.

Note

In general, FileMaker is very smart about when to open and close files. It opens a file when it needs to and closes it again when ...

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.