![]() |
For a full description of the JavaScript language, see the Mozilla Developer Center at http://www.mozilla.org/js/.
• Define the JavaScript function correctly. The function that Watcher will run, for example WatcherMain, must take one parameter:
• Identify or create any other scripts that your script will call. Automation Solutions has JavaScript files with predefined objects and functions that you may use, including:
Provides examples on how to use the VWorks plateDB object, which can be accessed by a script. For a description of the plateDB object, see plateDB object.
• Define any required global variables, such as folder paths. You should define the folder paths where processed files will be stored, such as the VWorks folder, the working folder, and an output folder, if applicable. For example, you might define the following:
• Include code at the end of the script to delete the input file from the monitored folder, if applicable. To prevent repeated processing of files upon restarting Watcher, the script should delete the input file or move it into a processed folder or output folder after processing the file.This section provides example script for scenario 2 in Description. In this scenario, Watcher monitors a folder for new input files, each of which specifies the attributes of a single protocol run. When a new input file appears in the folder, Watcher runs a script to create a working protocol based on a template protocol and an input file, and then schedules the protocol.