![]() |
This topic assumes that you know how to write programs in JavaScript or have basic programming knowledge. You must also have VWorks administrator or technician privileges.
In the following example, Watcher will monitor the Inputs folder for the file type .xml. When an .xml file is added to the folder, Watcher will run myscript.js and call the main function. The function main must be defined to take in one parameter, the full path of the file that has appeared in the folder to be watched.In the following example, Watcher will monitor the Inputs folder for the file types .xml and .rst (runset). When either file is added to the folder, Watcher runs myscript.js and calls the corresponding JavaScript function for the file type. The functions mainXML and mainRST must be defined to take in one parameter, the full path of the file that has appeared in the folder to be watched.
• Monitor the InputsXML folder for new .xml files, and then call the mainXML function. The mainXML function must be defined to take in one parameter, the full path of the file that has appeared in the folder to be watched.
• Monitor the InputsRST folder for new .rst files, and then call the mainRST function. The mainRST function must be defined to take in one parameter, the full path of the file that has appeared in the folder to be watched.
1 Select Tools > Options. The Options dialog box opens.
2 In the Watcher Options area, click the field next to Path to Watcher configuration file, and then click thebutton that appears.
3
4