Creating Script Sequence tasks
Create a
Script Sequence scheduled task to run an optional
pre-processing system-level script, next run a FileMaker script, and then run an optional
post-processing system-level script.
For example, create a script sequence that first runs a pre-processing system-level script that validates and reformats a text file exported from another database. Next, the script sequence runs a FileMaker script that imports the text file, combines it with data stored in a FileMaker Pro database, and generates multiple personalized reports in Excel format. Lastly, the script sequence runs a post-processing system-level script that creates a zip file of the reports and places them into a download directory for users.
When creating system-level scripts and FileMaker scripts for a script sequence, keep the following in mind:
•The pre-processing script (if one is specified) must return a value of 0 (zero) in order for the script sequence to proceed to the FileMaker script.
•The FileMaker script must complete successfully in order for the script sequence to proceed to the post-processing script (if one is specified). Scripting errors that do not abort the FileMaker Script will allow the sequence to proceed.
•The post-processing script (if one is specified) must return a value of 0 (zero) in order for the schedule to complete successfully.
•You can use the Documents folder as a shared location for passing import and export files between pre-processing scripts, FileMaker scripts, and post-processing scripts in Script Sequence scheduled tasks. The Documents folder is in the same folder as the server’s Backups, Databases, and Scripts folder.
•You must include error-handling and branching logic in your system-level scripts. Make sure that the script syntax is correct and does not hang due to infinite loops or the availability of external resources. You can select
Abort schedule if time limit reached or server stopped in the Schedule
assistant to abort the script sequence schedule if the sequence of scripts takes longer to run than the specified time limit, or if the Database Server stops. If you do not select
Abort schedule if time limit reached or server stopped and a system-level script hangs, look in the Event.log file for the process ID of the hung script to terminate. (See
Event log.)
For information about FileMaker script steps and functions, see
FileMaker Pro Help.
Note Enable email notifications in the Script Sequence scheduled task to receive a message for error or warning conditions, or confirmation of a successful completion.
Related topics