Adobe 65048332 Scripting Guide - Page 13

Layer Comp class, Channel class, Selection class, History State class, Document Info class

Page 13 highlights

CHAPTER 2: Photoshop Scripting Basics Photoshop Object Model 13 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 "Working with layer objects" on page 36. Layer Comp class The Layer Comp class allows you to create, manage, and view multiple versions of a layout within a single document. Channel class The Channel class is used to store pixel information about an image's color. Image color determines the number of channels available. An RGB image, for example, has four default channels: one for each primary color and one for editing the entire image. You could have the red channel active in order to manipulate just the red pixels in the image, or you could choose to manipulate all the channels at once. These kinds of channels are related to the document mode and are called component channels. In addition to the component channels, Photoshop lets you to create additional channels. You can create a spot color channel, a masked area channel, and a selected area channel. Using the commands or methods of a Channel object, you can create, delete and duplicate channels. You can also retrieve a channel's histogram, change its kind or change the current channel selection. For more information on channels, see "Working with Channel objects" on page 46. Selection class The Selection class is used to specify an area of pixels in the active document (or in a selected layer of the active document) that you want to work with. For more information on selections, see "Working with Selection objects" on page 42. History State class The History State 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 "Using history state objects" on page 47. NOTE: 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 "Using the Document Info object" on page 47.

  • 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
13
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
“Working with layer objects” on page 36
.
Layer Comp class
The
Layer Comp
class allows you to create, manage, and view multiple versions of a layout within a single
document.
Channel class
The
Channel
class is used to store pixel information about an image’s color. Image color determines the
number of channels available. An RGB image, for example, has four default channels: one for each primary
color and one for editing the entire image. You could have the red channel active in order to manipulate
just the red pixels in the image, or you could choose to manipulate all the channels at once.
These kinds of channels are related to the document mode and are called
component channels.
In addition
to the component channels, Photoshop lets you to create additional channels. You can create a
spot color
channel
, a
masked area channel
, and a
selected area channel
.
Using the commands or methods of a
Channel
object, you can create, delete and duplicate channels. You
can also retrieve a channel's histogram, change its kind or change the current channel selection.
For more information on channels, see
“Working with Channel objects” on page 46
.
Selection class
The
Selection
class is used to specify an area of pixels in the active document (or in a selected layer of the
active document) that you want to work with. For more information on selections, see
“Working with
Selection objects” on page 42
.
History State class
The
History
State
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
“Using history state
objects” on page 47
.
N
OTE
:
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
“Using the Document
Info object” on page 47
.