Adobe 23102480 Scripting Guide - Page 10

Containment Hierarchy, Application and Document Classes

Page 10 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 10 a new document, add a layer to an existing document, or change the background color of a layer. Most of the functionality available through the Photoshop CS3 user interface is available through the DOM. A good understanding of the Photoshop CS3 DOM, and how each aspect of the DOM relates to the Photoshop application and its documents will make script writing easier. Containment Hierarchy The Photoshop CS3 object model is a containment hierarchy, which means that objects in the model are identified partially by the objects that contain them. In Photoshop CS3, the Application object sits at the top of the hierarchy. Applications contain a Documents collection. The Documents collection contains Document objects. A Document object contains an ArtLayers collection, a HistoryStates collection, a Layers collection, a Layersets collection, and a Channels collection. Through using commands or methods in the DOM, you can tell Photoshop CS3 documents to add and remove objects, or set or change individual object properties like color, size and shape. In the diagram below, each node in the hierarchy represents a class in the Photoshop CS3 DOM. The Photoshop CS3 object model uses elements (AppleScript) or collections (VBScript, JavaScript) as a convenient way to group classes. We have not shown object elements or collections in the object model diagram below. Not all classes are associated with a collection. However, some key classes are grouped by elements or collection. The following elements/collections exist in Photoshop CS3: Art Layers, Channels, Color Samplers, Count Items, Documents, Layers, Layer Comps, Layer Sets, History States, Notifiers, Path Items, Path Points Sub Path Items, and Text Fonts. See Introduction to Scripting for more information on elements and collections. Caution: In Photoshop, VBScript collections index from 1 rather than 0. This stands in contrast to other VBScript arrays, which index from 0. . Photoshop Containment Hierarchy (showing key classes only) Application Notifier Document Preferences Selection Channel Layer Comp Count Item Path Item Art Layer Layer Set Color Measurement Document Sampler Scale Info History State Sub Path Item Path Point Text Item (Object) Art Layer Layer Set Application and Document Classes

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85

Photoshop CS3
Adobe Photoshop CS3
Scripting Guide
Photoshop CS3 Scripting Basics
10
a new document, add a layer to an existing document, or change the background color of a layer. Most of
the functionality available through the Photoshop CS3 user interface is available through the DOM.
A good understanding of the Photoshop CS3 DOM, and how each aspect of the DOM relates to the
Photoshop application and its documents will make script writing easier.
Containment Hierarchy
The Photoshop CS3 object model is a
containment
hierarchy
, which means that objects in the model are
identified partially by the objects that contain them. In Photoshop CS3, the
Application
object sits at the
top of the hierarchy. Applications contain a Documents collection. The Documents collection contains
Document objects. A Document object contains an ArtLayers collection, a HistoryStates collection, a
Layers collection, a Layersets collection, and a Channels collection. Through using commands or methods
in the DOM, you can tell Photoshop CS3 documents to add and remove objects, or set or change
individual object properties like color, size and shape. In the diagram below, each node in the hierarchy
represents a class in the Photoshop CS3 DOM.
The Photoshop CS3 object model uses elements (AppleScript) or collections (VBScript, JavaScript) as a
convenient way to group classes. We have not shown object elements or collections in the object model
diagram below. Not all classes are associated with a collection. However, some key classes are grouped by
elements or collection. The following elements/collections exist in Photoshop CS3:
Art Layers
,
Channels
,
Color Samplers
,
Count Items
,
Documents
,
Layers
,
Layer Comps
,
Layer Sets
,
History
States
,
Notifiers
,
Path Items
,
Path Points Sub Path Items
, and
Text Fonts
. See
Introduction to
Scripting
for more information on elements and collections.
Caution:
In Photoshop, VBScript collections index from 1 rather than 0. This stands in contrast to other
VBScript arrays, which index from 0.
.
Application and Document Classes
Application
Document
Art Layer
Channel
Selection
History
State
Photoshop Containment Hierarchy
Text Item
Layer Set
Layer Set
Path Item
Path Point
(Object)
Info
Document
Art Layer
Notifier
Comp
Layer
Preferences
Sub Path
Item
(showing key classes only)
Item
Count
Sampler
Color
Scale
Measurement