Appendix C: Scripting Events

Sub OnTerminate()
If you define a procedure with the above name, it will be called just before your script ends. This is useful if you need to transfer some final data somewhere, or close files.