Jump to content

executing a script according to time of day


This topic is 7157 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Is it possible to execute a script according to time of day - no clicking on buttons, no cursoring into a field? When the clock strikes X:XX the script runs automatically. Or is a purchased plug-in the only answer?

Thank you.

Link to comment
Share on other sites

It's also possible to do this with FileMaker alone, but it's a kludge. Basically, a script runs all the time, looping with a delay using Pause/Resume Script. Each loop checks the Status( CurrentTime ) against the time you want the script to run, and if they are equal (+/- some amount) then you have your script run.

code:


Loop

If [ Status( CurrentTime ) >= Time( 23, 0, 0 ) and Status( CurrentTime ) <= Time( 23, 1, 0 ) ]

Perform Script [ Subscripts, Your Script ]

End If

Pause/Resume Script [ 00:01:00 ]

End Loop

The above code will check the time once every minute and if the time is begtween 11:00 pm and 11:01 pm, will execute the script. If you script executes quickly (in under a minute) then you'd probably want to set the delay for less, otherwise it could run twice.

Chuck

Link to comment
Share on other sites

quote:

Chuck is right...it is a real pain...and not the most efficient way to handle it...so it is worth the plug-in price if you ask me...plus the Waves In Moiton plug-in has a bunch of other handy type of event items you can use.

Have you guys actually tried implementing an FM-only solution to this problem? I would think that it could be quite stable, if you put some amount of work into it.

The basic idea is to have a separate FileMaker file, which sole purpose is to run scripts in other files periodically. Now, one client (preferrably a server) would have to have a FMP application keeping this file open at all times, running the looped script to make sure that the scripts run even though no end-user is logged in. (The same would apply when using any plug-in, right?)

To make sure that the script does not run more than once for each time period you would want it to run, you would have to assign status values to globals that indicate the time of script "starts" and "stops" of the scripts you run in the other files.

This approach together with letting scripts writing log files and/or sending e-mail to a database administrator when errors occur would suffice for most situations I would think.

Comments are welcomed!

Daniel

Link to comment
Share on other sites

If you have using MacOS 9, use iDo Script Scheduler (http://www.sophisticated.com/products/ido/ido_ss.html)

It freeware/shareware runs AppleScripts a specified intervals or certain times in a day. Then all you have to do a make a small AppleScript that tell FM to preform a script.

Link to comment
Share on other sites

This topic is 7157 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.