Adobe Smoke Alarm CS3 Manual De Usuario
Photoshop CS3
Adobe Photoshop CS3 Scripting Guide
Scripting Photoshop CS3 45
VBS
Set chanRef = docRef.Channels.Add
chanRef.Name = "My Channel"
chanRef.Kind = 3 'psSelectedAreaAlphaChannel
chanRef.Name = "My Channel"
chanRef.Kind = 3 'psSelectedAreaAlphaChannel
docRef.Selection.Store docRef.Channels("My Channel"), 2
'PsSelectionType is 2 (psExtendSelection)
'PsSelectionType is 2 (psExtendSelection)
JS
var chanRef = docRef.channels.add()
chanRef.name = "My Channel"
chanRef.kind = ChannelType.SELECTEDAREA
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
Channel
object, use the
load (Load/load)
method.
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)
'PsSelectionType is 2 (psExtendSelection)
JS
selRef.load (docRef.channels["My Channel"], SelectionType.EXTEND)
See section
selections.
Working with Channel Objects
The
Channel
object gives you access to much of the available functionality on Photoshop CS3 channels.
You can create, delete, and duplicate channels or retrieve a channel's histogram and change its kind. See
for information on creating a
Channel
object in your script.
You can set or get (that is, find out about) a
Channel
object’s type using the
kind
property. See
for script samples that demonstrate how to create a selected area
channel.
Changing Channel Types
You can change the
kind
of any channel except component channels. The following examples
demonstrate how to change a masked area channel to a selected area channel:
Note:
Component channels are related to the document mode. Refer to Photoshop CS3 Help for
information on channels, channel types, and document modes.
information on channels, channel types, and document modes.