User manual

Table Of Contents
B-2
FileMaker Pro User’s Guide
4. Enter the following script:
Set Error Capture [On]
Show message [“Click to reset counter to zero”]
{default button = “No”, 2nd button = “yes”}
If [“Status (CurrentMessageChoice)=2”]
Set Field [“Count Field”, “0”]
Else
Set Field [“Count Field”, “Count Field + 1”]
If [“Count Field > 4”]
Save a copy as [“Backup Copy”]
Set Field [“Count Field”, “0”]
End if
End if
5.
After adding all the steps above, click OK.
6. Click Done.
7. Choose Edit menu > Preferences > Document.
8. In the General tab (Windows) or the General pop-up menu
(Mac OS), under When closing <solution filename>, select the Perform
script checkbox.
9. Select the script Backup.
10. Click Done.
11. Close the solution file.
Once these steps are executed, you will have a script that will create
a backup of your file every fifth time you close the file.
Maintaining files
While consistent backups are the most important form of regular
maintenance you can perform on your databases, most heavily used
databases are also good candidates for routine compression.
When you have FileMaker Pro save a compressed copy,
FileMaker Pro rewrites the entire database, fitting as much data into
each block as is possible. This procedure not only reclaims unused
space in the file, it also rebuilds the file’s structure. Compression can
be time-consuming if the file is large, however, and might be best
accomplished as an overnight task.
Saving a compressed copy
1. Make sure that you have enough room on your intended storage
media.
While a compressed copy may be significantly smaller than an
uncompressed copy, we strongly recommend that you have at least
as much free space on your intended media as the size of your
uncompressed file. It is not a good idea to fill any storage media up
to its maximum capacity.
2. Choose File menu > Save a Copy As.
3. Choose compressed copy (smaller) from the Save a drop-down list
(Windows) or Type pop-up menu (Mac OS). You can also change the
default name of the file and/or its location at this time.
4. Click Save.
Understanding file damage
In order to understand how corruption occurs, it is useful to know
how FileMaker Pro manages data.
FileMaker Pro is a disk-based application, so it does not need to load
the entire database into RAM as the file is opened. Instead, the
application transfers data as needed from the hard drive to RAM and
back; as the file is used, updated data is written from data buffers in
RAM to the hard drive. The most common cause of file damage is an
unexpected application termination. In most cases, an unexpected