Install on Timer & Exit Application
I would like to write a script to save a copy of my file, then shut down FMP every evening at 9pm or so. (A backup program will then backup the file sometime later.) I am hoping to use Install on Timer with the Save a Copy as and Exit Application commands to do this. I'm new to FMP and DB's in general, and although I've searched, I can't find answers to some of my questions.
My system: FMP 10, OSX 10.4, 3 users. A Mac Mini is a server and also hosts one of the three users. At the time the scripts would run, the two users on the network are always logged out. Random Roxie, the user on the Mac Mini is probably not logged out, and can't be trusted to log out every day. But I think I read somewhere that if the network users are logged out, the exit application command will close the local user and exit. If that won't work, then I need another script to exit that user.
First, this is what I have think might work, but I haven't gotten it to work.
Install OnTimer Script ["Exit App 9PM; Interval 600]
This is the Exit App 9PM script:
If [Get ( CurrentTime) > 9 PM and Get ( CurrentTime ) <11 PM]
Save a Copy as [copy] (this will point to the local drive)
My basic idea is to have the script run every 10 minutes, check the system time, and if the time is between 9 pm and 11 pm, save a copy as, and them exit the application. The program will then be restarted the next morning. (I want to restart it daily, as when we leave FMP up and running for a while, we seem to get to get errors where records don't commit and are lost. I thought it was operator error first, but now I think it's FMP.)
There are several things I don't know. For the Install OnTimer Script:
1) I am not sure what triggers this script, or how to assign a trigger to it. (I've written and triggered other simple scripts.)
2) I am not sure how the script is applied to a window. (I only use one window.)
For the If script, I don't know the correct nomenclature, or if what I am trying will work in an If script. I would prefer that the Save a Copy as step uses the same name every time and overwrites the previously saved file. The backup in the cloud will keep the daily versions. Can somebody please give me some advice?
Thanks much for your help. If you're in Denver, stop by for a really good cup of coffee.