Jump to content

Automating Script Firing


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

Recommended Posts

I have a script that I need to fire about once every six hours. I tried just writing a simple loop and a counter, so I'd have to reset it every couple days as a test.

Wasn't tickled about tying up the computer, but seemed a simple fix. However, the script only fires once. Is there a better way to automate a script function? Seems silly to have to purchase a plug-in for such a anticipated task.

I'm running FM Server on a Win NT machine. Any help would be greatly appreciated. My backups and notifications are running great, just tied up on this one issue.

Link to comment
Share on other sites

OK, I'm going off the top of my head here, not having done something like this, but it seems to me that a loop is the right track.

First, write the script that you want to perform every six hours. Have this as a separate script that the looping script will call.

Then you looping script will look something like this:

Loop

Link to comment
Share on other sites

Chuck is on the right track. I've used similar script to perform periodic backups or to open FM files in a non-server environment. You might want to open up the windows to say 5 minutes, then add a pause of 5 minutes to prevent repeating the operation within the interval. The danger if the interval is too small is that you will jump over the comparison. The one minute pause and one minute window should work, but I never entirely trust this software stuff! -bd

Link to comment
Share on other sites

I'm assuming that pausing a script works kind of like an idle handler in AppleScript, which can be used to similar effect (if you were using a Mac, that's what I'd recommend, and how I have handled such situations before. With idle handlers, the time you specify it to return by could be off by more or less than what you want, and this could add up over time, so that if you tell it to pause for 1 second, it might actually pause for 5 seconds, and eventually your script could be running at 10 am instead of 6 am. But experiment and see what works. When the script runs, have it stamp a time field with the current time and keep track of exactly when it's running. I've never actually done what you're doing, so it's new to me. Let us know what you find out.

Chuck

Link to comment
Share on other sites

  • 2 weeks later...

I tried the simple loop, but it didn't want to run more than once. Of course, I just tried to pause for six hours, then run again. Absolutely did not work.

I will try the more complicated script and see how that works out. Dissappointed that this ties up FM on the computer though - I get an hour-glass during the running of the script, so that's one copy that is out of the running.

Thank you very much for your help, and I'll let you know how it works out!

Link to comment
Share on other sites

Unfortunately, I'm not nearly as much a Windows expert as a Mac expert, but there must be some utility available for Windows that will open a file at specified times. There must be some way to do this.

Assuming that you find such a way, then you can do this without tying up the computer with a Loop. Create a FileMaker file that when opened has as its preference to run a script. All this script will do is have a Perform Script [External] that runs the script you want to run periodically and then a Close statement. Tell your utility to open this file every six hours, and you should be set.

Any Windows experts know of such a utility that can open files periodically?

Chuck

Link to comment
Share on other sites

I like to use a program called WinTask Scheduler. The advantage is that this program also allows me to program and schedule repetitive OS level operations. I can still call FileMaker scripts with the added benefit of being able to "script" Windows. This product works well with Windows 2000 Professional and Windows 2000 Advanced Server. A demo version can be downloaded from www.wintask.com.

Link to comment
Share on other sites

Hello,

On Windows, you need a good scheduler for this. I strongly advise LAUNCHPAD. (http://www.cypressnet.com/)

We use it on our FM Server, to set the server in PAUSE mode during the night, so we can backup our files in an proper way. This way of working is recomended by FM for a good backup !!!!!!

And we use it on our batch PC. This is a FM client-PC with a dozen of tasks in LAUNCHPAD. During day (and night) this client is performing several tasks (you can launch .FP5 files), like calculating the customers open saldo on orders, importing data from suppliers, etc ...

If you use this solution, the server and batch PC are not 'tight'in a pause/resume battle as you already discovered !

Erwin

Link to comment
Share on other sites

  • 2 weeks later...

Thank you very much for all your help. I've set the script to fire based upon user input from four different workstations for now (it'll be hit and miss on the time for a couple weeks, but this still shows some forward progress), and I'm looking at the docs for Winlaunch now.

Link to comment
Share on other sites

This topic is 8328 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
×
×
  • Create New...

Important Information

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