Run it from a "robot file".
A robot file is a simple FileMaker file with no data or tables but with two key features:
An auto entered account name and password that matches to an account in the hosted file with sufficient privileges to run the script successfully.
A script, set to run when the file opens that performs the script in the hosted file to save the PDF ane email it. Last step in the script is either close file or exit application. (depends on whether you need to leave FileMaker open when the script finishes or not.)
You then use an operating system based scheduler to open the robot file on a schedule you specify.
If I'm understanding correctly then, the Robot file would also be hosted on Server, correct? No other machines need to be on for this to run?
Thanks Phil, I'll give it a shot.
... actually, now that I'm digesting this, I'm not sure I understand.
If I want the script to run at 11:59, when all the local machines are shut down except for Filemaker Server, what are my options?
Because if I'm understanding correctly, a robot file on the server would be the same as running the main file on the server, right?
Therefore, are you saying the robot file should be on a local machine that is NOT shut down at the end of the work day?
FileMaker Inc. does not recommend running Fmp Pro on the same machine as the server, but it does work and it connects to the server hosted database just like it would from a client machine and the script runs as a client instance. If I remember correctly, you have to be careful not to have web publishing (if you publish DB to web) or sharing in order for this to work smoothly.
Ok, so this is what I understand:
(I know almost nothing about how Filemaker Server works, btw)
On filemaker server, you have Solution A and Solution Robot.
Solution A is the big massive database, which contains the data upon which you want to report daily. "Report Script," which tallies this data, lives within in Solution A.
Solution Robot is a small solution, that does one thing upon opening: opens Solution A and runs "Report Script".
"Report script" Finds / sorts certain data, and "save records as PDF", then emails it, then closes both solutions.
We would set the Filemaker Server scheduler to open Solution Robot at 11:59 pm every day.
A) do I understand correctly? B) is there a safer way to do this? If we had a dedicated computer left on all night to be the local host for the solutions, would that be safer?
You cannot use a FileMaker Server Schedule to open the solution robot file. You must use an operating system based scheduling tool such as windows task manager to open it. If you use server, it will not run as a client of the system and that's the key requirement here.
I suggest testing this robot file carefully to determine if it will work as you need it. The technical details required for this to work depend on the scheduling utility and your OS platform so it may take a few tests before it launches when you need it to.
We've used this approach with a robot file and FileMaker installed directly on the server for several years, but we also don't publish to the web.