JScript with ACL
JScript expressions or scripts can be called from ACL with one of the following ACL primitives:
• jscript — Function that evaluates a JScript expression and returns the result as a string.
• js — Command that evaluates a JScript expression and displays the result.
• source — Command that interprets files ending in .js as JavaScript programs to be executed when set javascriptinterpreter is set to jscript.
The flow of control in the JScript interface usually starts with the execution of one of these ACL functions or commands, with the exception of customization files ending in .js. Arbortext Editor and the Arbortext PE sub-process automatically load and execute JScript programs from the doctype.js, instance.js, and document.js files following the same rules as doctype.acl, instance.acl, and docname.acl files.
The JScript interpreter starts the first time Arbortext Editor or the Arbortext PE sub-process executes one of these ACL functions or commands or reads a .js customization file. Arbortext Editor and the Arbortext PE sub-process will also start the Java Virtual Machine, if necessary. You may also specify the -jvm and -js startup command options to start JScript when Arbortext Editor is opened.
Unlike the Java interface, only string arguments are passed from ACL to JScript. ACL arrays must be converted to some form of delimited string (for example, as an array literal) or passed element by element to JScript expressions. Refer to
Passing Arrays Between JavaScript and ACL for more details.
JScript objects may not be returned directly to ACL. If the result of a JScript expression passed to javascript is an object, the toString method is invoked on the object and that value is returned by javascript.