Photoshop CS Scripting Guide
12
Scripting basics
Object Model
2
Layer Classes
Photoshop has 2 types of layers: an
art layer
that can contain image contents and a
layer
set
that can contain zero or more art layers.
An Art Layer is a layer class within a document that allows you to work on one element of an
image without disturbing the others. Images are typically composed of multiple layers (see
Layer Set, below). You can change the composition of an image by changing the order and
attributes of the layers that comprise it.
A Text Item is a particular type of art layer that allows you to add type to an image. In
Photoshop, a
text
item is implemented as a property of the art layer. For more information on
text items, see
Section 3.11 on page 77
.
A Layer Set is a class that comprises multiple layers. Think of it as a folder on your desktop.
Since folders can contain other folders, a layer set is recursive. That is, one layer set may call
another layer set in the Object Model hierarchy.
For more information on layers, see
Section 3.10 on page 72
.
History Class
The History class is a palette object that keeps track of changes made to a document. Each
time you apply a change to an image, the new state of that image is added to the palette. These
states are accessible from document object and can be used to reset the document to a previous
state. A history state can also be used to fill a selection. For more information on history
objects, see
Section 3.16 on page 94
.
N
O T E
:
In AppleScript, if you create a document and then immediately try to get history state,
Photoshop returns an error. You must first activate Photoshop -- make it the front-most
application -- before you can access history states.
Document Info Class
The Document Info class stores metadata about a document. Metadata is any data that helps to
describe the content or characteristics of a file.For more information on document info, see
Section 3.9.2 on page 70
.
N
O T E
:
Not shown in the Object Model are collections. A collection is a convenient way of
grouping classes. Not all classes are associated with a collection.
2.3.1 Additional Containment Classes
In addition to the classes described in the Object Model, other classes allow you to open and
save objects in various formats and to specify color options.