ECMAScript objects can be created in a library, driver object, Publisher channel, or Subscriber channel.
In the Outline view, right-click the location to create the ECMAScript object, then select New > ECMAScript.
Specify the name of the ECMAScript object.
Select the check box for Open the editor after creating the object, then click OK.
Click Yes in the file conflict message to save the ECMAScript object.
Either type the ECMAScript, or copy the ECMAScript into the editor from an existing file.
To save the ECMAScript press Ctrl+S after the ECMAScript is finished.
For information on how to use the ECMAScript editor, see Section 10.0, Using ECMAScript in Policies.