Working With Channel Objects; Changing Channel Types - Adobe 65014912 Manual

Photoshop cs4 extended
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER
examples use the
selection in a channel named
that channel.
AS
set myChannel to make new channel of current document with properties ¬
{name:"My Channel", kind::selected area channel}
store selection of current document into channel ¬
"My Channel" of current document combination type extended
VBS
Set chanRef = docRef.Channels.Add
chanRef.Name = "My Channel"
chanRef.Kind = 3 'psSelectedAreaAlphaChannel
docRef.Selection.Store docRef.Channels("My Channel"), 2
'PsSelectionType is 2 (psExtendSelection)
JS
var chanRef = docRef.channels.add()
chanRef.name = "My Channel"
chanRef.kind = ChannelType.SELECTEDAREA
docRef.selection.store(docRef.channels["My Channel"], SelectionType.EXTEND)
To restore a selection that has been saved to a
AS
set myChannel to make new channel of current document with properties ¬
{name:"My Channel"}
load selection of current document from channel "My Channel" of ¬
current document combination type extended
VBS
selRef.Load docRef.Channels("My Channel"), 2
'PsSelectionType is 2 (psExtendSelection)
JS
selRef.load (docRef.channels["My Channel"], SelectionType.EXTEND)
See section
selections.

Working with Channel objects

The
Channel
can create, delete, and duplicate channels or retrieve a channel's histogram and change its kind. See
"Creating New Objects in a Script" on page 23
You can set or get (that is, find out about) a
and storing selections" on page 45
channel.

Changing channel types

You can change the
demonstrate how to change a masked area channel to a selected area channel:
N
: Component channels are related to the document mode. Refer to Photoshop Help for information
OTE
on channels, channel types, and document modes.
store (Store/store())
My Channel
"Understanding Clipboard Interaction" on page 54
object gives you access to much of the available functionality on Photoshop channels. You
of any channel except component channels. The following examples
kind
command of the
and extend the selection with any selection that is currently in
Channel
for information on creating a
object's type using the
Channel
for script samples that demonstrate how to create a selected area
Working with the Photoshop Object Model 46
object to store the current
Selection
object, use the
load (Load/load)
for examples on how to copy, cut and paste
Channel
kind
method.
object in your script.
property. See
"Loading

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents