Nestor Posted January 25, 2008 Posted January 25, 2008 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.
aholtzapfel Posted January 25, 2008 Posted January 25, 2008 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
aholtzapfel Posted January 25, 2008 Posted January 25, 2008 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)
Nestor Posted January 25, 2008 Author Posted January 25, 2008 Thanks for the Help. I tried the last one and it worked perfectly. thanks for the input.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now