Use a Scheduled script on the Server - assuming you're using FMS.
There are some differences when using a server side script. Any context that needs to be set will need to be done in the server script. Assume that a new user session is being created.
Therein lies the problem. We are using Pro 13.
Use the windows scheduler or launchd on OSX to launch a shortcut that opens your .fmp12 file at midnight. Then have the OnFirstWindowOpen trigger in your file run the appropriate script assuming it's in the same timeframe.
it launches a small database which on startup pauses for 10 seconds then runs a script in a specific database.
P.S. : mikebeargie, it's free and available on both platforms so you might think about adding it to your searching for free resources list
The FM file runs on a Windows PC all night. Will Task Till Dawn trigger my FM script directly?
Thanks for the info Mike.
You didn't specify Mac or Windows. But, if using a Mac, there is this old kludgy (but effective) way to do it.
In the ENERGY SAVER preferences there is a scheduler. We used to have a computer shut down then restart at midnight. In the User account "login items" we added a small filemaker file that executed a script in the main database then quit Filemaker at conclusion. Btw - the script would only execute between 12:05 and 12:15 am.
Like I say, kludgy, but it worked for years.
Hardware: the parts of a computer that can be kicked. ~Jeff Pesis
Another option, for Windows only, is to use the FM ActiveX interface (look it up in the help). You can write a VBscript or PowerShell that uses it and use the Windows Task Scheduler to run it
Use the Windows Task Scheduler.
In the task scheduler, the command you want to run is 'FileMaker.exe', and the argument is a URL specifying the path to the FileMaker Pro file and a script to run. It looks something like this:
So if your FileMaker file is saved at c:/Users/paulwatts/Documents/FilemakerFile.fmp12, and your script to run was named "NightlyScript" (and the only script so named), your URL would look like this:
This video outlines the process, but where it specifies a path to Chrome for the program to run, you want to specify the path to FileMaker Pro, and where it specifies a web page, you want to use an fmp URL.
There's more info about fmp:// URLs here. It talks about opening them remotely, but you can specify a local file as well:
if using a Mac, there is this old kludgy (but effective) way to do it.
I think the new, less kludgy way (without a restart) would be to use iCal aka Calendar, define an event to be repeated every day, choose “Open file” as the “alert” to be performed and select your FM launcher file, or e.g. an AppleScript that executes the script in the main database.
In Mac OS X, the official way to go is the launchd system service. For a GUI tool to configure that, look at Lingon, or for a web-based tool that generates .plist files and helps you load them, check Launched.
Launchd is a bit more robust than iCal for this sort of thing. You'd want to be sure the Mac was set to automatically login as the relevant user.
It's up to you to decide how important a confirmation for you is.
Some solutions offered in the above posts offer a logfile which lets you know immediately what happened and more than that, whether it happened or not. Some don't. Choose wisely.
[…] the launchd system service. For a GUI tool to configure that, look at Lingon
Thanks for the link.
does not work anymore.
Well, it sounded good in theory …