Databases can contain sensitive data. Sometimes you have a database you only open occasionally, but you don’t want to forget and leave the data file open on your computer. There are other solutions to this, including locking your computer screen after a set interval, but if you find that procedure overkill and just want to lock down one or two databases, FileMaker Pro (FM 10 or greater) has a solution for you: setup an Install OnTimer script that closes the database after a set interval minutes.
The ‘On Open’ script contains an OnTimer Script with an interval of 5 minutes
The script it calls after the interval is the ‘Close Database after 5 minutes’ script.
Specify the interval in seconds
Enter the time before it executes in seconds (5 minutes x 60 seconds = 300)
More details on the Ontimer functions are available in FileMaker’s Help system.
Of note, the script step does not work in FileMaker Server, so this is designed for a local environment. On FileMaker Server there are other options, including a forced logout after a specified period of inactivity.
‘Close Database after 5 minutes’ Script
All this script does is close the database file.
File Options – On Open Script
To set up the script to run On Open, go into the File Options… under the File menu.
OnFirstWindowOpen run the On Open script
Select ‘Script Triggers’ panel and set the OnFirstWindowOpen script to ‘On Open’, which contains the timer to close itself after five minutes. Whenever the database is opened, a timer starts counting down. After five minutes, or whatever interval you have set, the database will close.
You could put more error checking into the script, test to see if a record is in use etc, but for my uses simple is best. Now you never have to remember to close that important FileMaker Pro file.