instead of using the kill command outside of filemaker I could use a "install OnTimer Script" in my "open script" to execute my backup (Save a copy as) script and then also set "install OnTimer Script" to run at the end of my backup script which I run on close of filemaker this would set the script to run on a continual loop. Would have to remove the run of the backup on close but would not matter because the db was be getting backed up on an interval in seconds I specify?
What do you think of this instead of my first thought? Or any additional thoughts?
If you're using Pro, use a FileMaker Script to create a compact copy of all your files.
You can then send a visual basic script or an apple script to run the script.
This will keep the copy of FileMaker Pro running, while safely creating a backup of your files and have a process that runs as a schedule on the OS.
Just so you know :
There's a download of run script by redirection that has a VB script that shows an example of code in the container field on how to run a script in FileMaker using VB script.
If you're looking to do this through Applescript :
pg 4 of the applescript reference tells you how to run a script in FileMaker through Apple Script.
having a little trouble figuring out this script. When I run the DB it opens up and you select numbered scripts.
I then generate the vbs and look at the code and can't figure out how to edit it to how I need or use the db you download so it generates the proper code.
having a little trouble figuring out this script. When I run the DB it opens up and you select numbered scripts. I then generate the vbs and look at the code and can't figure out how to edit it to how I need or use the db you download so it generates the proper code. ' Region Description ' ' Author: Wim Decorte ' Version: 1.0 ' Description: Calls a FM script. The name of the file and the ' name of the script are passed as command line ' arguments when executing this VBscript ' ' ' EndRegion Option Explicit Dim fmApp, fmDocs, fmDoc Dim theFile, theScript ' check that there were 2 arguments If WScript.Arguments.Count <> 2 Then ' do nothing at all, fail silently Else theFile = WScript.Arguments.Unnamed.Item(0) theScript = WScript.Arguments.Unnamed.Item(1) ' hook into FileMaker Set fmApp = CreateObject("FMPro.Application") fmApp.Visible = True ' get the collection of open files Set fmDocs = fmApp.Documents ' go find our target file For Each fmDoc In fmDocs If InStr(LCase(fmDoc.fullname), LCase(thefile)) > 0 Then ' this is our file, run the script fmDoc.dofmscript (thescript) End If Next End If ' clean up Set fmDoc = Nothing Set fmDocs = Nothing Set fmApp = Nothing
Where do I tell it which DB to interact with and which script?
Example DB is BBBB.fp7 Example Script is "script123"
The comment at the top of the VBScript should answer your question.
The VBscript takes 2 command lines, one is the file and one is the script.
The first variable is the file name and the second the script name.
so when you run the VBscript, it would be : <Vbscriptname> BBBB.fp7 script123
There's no need to edit the code.
ok so if I name the script fmpscriptrunner.vbs
then in the schedule task I would call fmpscriptrunner.vbs BBBB.fp7 script123
or put that command in a batch file and call the batch file in the scheduled task.