Adobe 65014293 Scripting Guide - Page 12

Application and document classes, Layer classes, Photoshop containment hierarchy

Page 12 highlights

CHAPTER 2: Photoshop Scripting Basics . Photoshop containment hierarchy (showing key classes only) Application Photoshop Object Model 12 Notifier Document Preferences Selection Channel Layer Comp Count Item Color Sampler Measurement Scale Document Info History State Path Item Art Layer Layer Set Sub Path Item Text Item (Object) Path Point Layer Set Art Layer Application and document classes The Application class is the root of the Photoshop object model hierarchy. Scripts must target the appropriate application in order to run correctly. See "Targeting and Referencing the Application Object" on page 22. The Document class is used to make modifications to the document image. By using the Document object you can crop, rotate or flip the canvas, resize the image or canvas, and trim the image. You could also use the Document object to get the active layer, then, save the current document, and copy and paste within the active document or between different documents. For more information on using document objects, see "Creating New Objects in a Script" on page 23 and "Using the Document object" on page 34. Layer classes Photoshop has two 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, defined by a Layer Set. 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 item is implemented as a property of the art layer. For more information on text items, see "Using the Text Item object" on page 41.

  • 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
  • 86
  • 87

C
HAPTER
2: Photoshop Scripting Basics
Photoshop Object Model
12
.
Application and document classes
The
Application
class is the root of the Photoshop object model hierarchy. Scripts must target the
appropriate application in order to run correctly. See
“Targeting and Referencing the Application Object”
on page 22
.
The
Document
class is used to make modifications to the document image. By using the
Document
object
you can crop, rotate or flip the canvas, resize the image or canvas, and trim the image. You could also use
the
Document
object to get the active layer, then, save the current document, and copy and paste within
the active document or between different documents. For more information on using document objects,
see
“Creating New Objects in a Script” on page 23
and
“Using the Document object” on page 34
.
Layer classes
Photoshop has two 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, defined by a
Layer
Set
.
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
TextItem
item is implemented as a property of the art layer. For more information on text items, see
“Using the Text Item object” on page 41
.
Channel
Selection
History
State
Photoshop containment hierarchy
Path Item
Path
Info
Document
Notifier
Preferences
Sub Path
Item
(showing key classes only)
Item
Count
Sampler
Color
ment
Measure-
Point
Document
Application
Scale
Text Item
(Object)
Art Layer
Layer
Comp
Layer Set
Art Layer
Layer Set