You can also set up a "robot file" to run scripts on a schedule when the script must run from a client perspective instead of from a server schedule.
Create a small FileMaker file with a simple script like this:
Perform Script [//selectscript in hosted file that exports the field contents here]
Exit Application //or use close file if you want to leave FileMaker Application up and loaded
Use File Options to specify that this script run automatically whenever the file is opened.
Use windows task manager to schedule when this small file will be "run" (Opened).
If you have passwords that control access to your hosted file like you should, define a matching account name and password in the robot file and use File Options to specify that the file open itself with this account name and password automatically.
This all makes sense, but I have a few questions.
Would this robot file need to be opened on the Filemaker server or one of the client machines?
I do not have administrator privileges to the server, so I cannot schedule a task to open the robot file. Is there some other way to accomplish this?
It can be set up on any machine on your network where FileMaker is installed. Installing FileMaker on the Server machine isn't recommended, but you can get away with it (we do) if you take precautions. (We set the task manager to do this late at night when no one else is using the DB and also do not publish anything to the web.)
Just to clarify, I create the robot file, open the robot file on the FM Server Console. I assume the robot file should remain open on the console at all times.
Then use windows task manager on a machine that has FileMaker client installed to schedule opening the robot file. I assume that this machine would need to be turned on at all times. The startup script executes the export script. The export script should end with closing the file.
When I use the windows task manager, how do I specify a user account and password for opening the file?
No need to open the robot file on the console. You do not need this file anywhere but on the machine where you set up task manager to run the file. The start up script ends by closing the file. The export script does not.
Specify account name and password in File Options of the Filemaker file--not the windows task manager. When the file opens, it will automatically open with the specified account name and password, then run the script.
You might want to add code in the start up script that prevents the script from running when it has been opened with a full access account. That way, you can open the file by holding down the shift key, enter your admin password and be able to modify the file's script without it first kicking in and exporting the data. (I tend to forget this step as I can use FileMaker advanced with the script debugger to open the file and cancel the start up script instead.)
I have tested everything and it works great. Thanks for all your good help.