Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Im trying to make it so that my database runs a script at a certain time by itself. Is there a way to do that.

I want to update my records, and i have a script that will do that, but i need to make it so that it does it automatically every night at a certain time.

Thanks in advance.

Posted

This could be done using the windows task Scheduler to run a VBS script that runs the filemaker script (Other options: starting a script with a loop in it that runs until the specified time or using a plug-in)

The Following saved as a .vbs might do it (I have not tested this)

Set objFM = WScript.CreateObject ("FMPRO.Application")

Set WshShell = WScript.CreateObject("WScript.Shell")

FMfile = "C:yourpathtoyourFMFileyourfile.fp7"

Wscript.Sleep 10

objFM.Visible = True ' show FMPro

WshShell.AppActivate ("FileMaker Pro")

Set objFMfiles = objFM.Documents.Open( FMfile,"username","password")

objFMfiles.DoFMScript ("yourscript") ' call this FM script

(Important note: make sure the FM script you are calling is placed above any script folders and is not in a script folder itself, a bug in ver 9 will cause the wrong script to be called if it is.)

a loop may be needed in the above script in order to allow the filemaker app or file to open (if it isn't already)

Hope this helps a little.

Allen

Posted

OR....

you could just point the task Scheduler to a FM file that holds a single script that is set to run when opened (that would be an easier solution)

This topic is 6148 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.