2 Replies Latest reply on Jul 20, 2010 8:43 AM by philmodjunk

    How do I write a script to run every Monday morning?

    NickDee

      Title

      How do I write a script to run every Monday morning?

      Post

      I have had a look at Install OnTimer Script and notice that is calculates in second(s) intervals to make use of it.

      I want to write a script (like a cron job) to enable a particular (existing) script to run every Monday morning at one minute past midnight. (not every seven days, but specifically Monday 00:01:00).

      Can you help me with this please?

        • 1. Re: How do I write a script to run every Monday morning?

          Can you use FileMaker Server? There you have the possibility to schedule scripts.

          Not sure if you can specify the day of week there, if not, just run it every day and check for Monday as the first step (look for the DayName function...)

          Using something like OnTimer and running it on a workstation just screams "unstable" in my opinion... ;-)

          • 2. Re: How do I write a script to run every Monday morning?
            philmodjunk

            Use cron to launch a special purpose filemaker file. Set up the file with file options that call a script when the file is opened. Write the script to perform the script in your main file. This is called a "robot" file by many developers. Make the last step in your script either close file so the robot file closes itself or Exit Application to quit filemaker altogether depending on whether you need filemaker to be up and running after the robot file does its thing.

            If you can use cron to open the file only on Mondays, you're done. If you find you can only schedule it to open daily, modify the script in your robot file to check the day of the week. If it's Monday, perform the script in your main file. If it's not, simply quit.

            If the files are hosted from filemaker server and the script in question is fully server compatible, you can also use filemaker server to schedule the script.