Customizer's Guide > Working with ActiveX Controls > Overview > Running Scripts
  
Running Scripts
When working with ActiveX controls, keep the following items in mind:
To call an ActiveScript from another ActiveScript, use the Application.createScriptContext and ScriptContext.loadScriptFile methods. Do not use the ACL source command from within a JScript or VBScript file as in:
Acl.execute("source test.js");
Calling the source command from an ActiveScript will report an error message in the parent script if the child script contains errors. If both scripts are error free, the nesting will silently fail.
Any session-level scripts placed in Arbortext-path\custom\init or any directory defined by the APTCUSTOM environment variable will be executed automatically when Arbortext Editor starts.
Any document type level scripts (such as Arbortext-path\custom\doctypes\axdocbook\axdocbook.js) will be run automatically the first time a document of the named document type is opened or created. The doctype.* file is not run on subsequent openings of files of the same document type.
Any document-level scripts (such as Arbortext-path\custom\doctypes\axdocbook\instance.js) will be run automatically each time a document of the named document type is opened or created.
Any instance-specific scripts (such as filename.vbs where filename is the same root name as that of the document) will be run each time a specific document of that name is opened or created.