Note: Because you open JavaScripts through the application itself, you do not need to use the
Application object as part of the containment hierarchy that describes an object.
However, if you choose to include the Application object in your code, you must use the
pre-defined global object name app, rather than the class name Application, in a script, as in the
following sample:
var docRef = app.documents.add(800, 600, 72, “docRef”, NewDocumentMode.RGB)
The following sample uses the Application object incorrectly:
var docRef = Application.documents.add(800, 600, 72, “docRef”,
NewDocumentMode.RGB)
However, the most common way to add an element in your code is to omit references to the
Application object altogether, as in the following sample:
var docRef = documents.add(800, 600, 72, “docRef”, NewDocumentMode.RGB)