
Adobe Photoshop CS3
JavaScript Scripting Reference
JavaScript Object Reference 45
Application
The Adobe Adobe Photoshop CS3 application object, which contains all other Adobe Photoshop CS3
objects.
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)
Properties
Property
Value Type
What it is
activeDocument
Document
Read-write. The frontmost document. (Setting this
property is equivalent to clicking an open
document in the Adobe Photoshop CS3
application to bring it to the front of the screen.)
backgroundColor
SolidColor
Read-write. The color mode for the document’s
background color.
colorSettings
String
Read-write. The name of selected color setting’s set.
displayDialogs
DialogModes
Read-write. The dialog mode for the document,
which indicates whether or not Adobe
Photoshop CS3 displays dialogs when the script
runs.
documents
Documents
Read-only. The collection of open documents.
fonts
TextFonts
Read-only. The fonts installed on this system.
foregroundColor
SolidColor
Read-write. The default foreground color (used to
paint, fill, and stroke selections).
freeMemory
number (double)
Read-only. The amount of unused memory
available to Adobe Photoshop CS3.
locale
string
Read-only. The language location of the
application.
macintoshFileTypes
array of strings
Read-only. A list of file image types Adobe
Photoshop CS3 can open.
measurementLog
MeasurementLog
The log of measurements taken.