Photoshop CS Scripting Guide
89
Scripting Photoshop
Channel object
3
VB:
Dim theChannels As Variant
theChannels = Array(docRef.Channels("Red"), docRef.Channels("Blue"))
docRef.ActiveChannels = theChannels
JS:
theChannels = new Array(docRef.channels["Red"],
docRef.channels["Blue"]);
docRef.activeChannels = theChannels;
Or you can easily select all component channels by using the “component channel” property
on the document:
AS:
set current channels of current document to component channels ¬
of current document
VB:
appRef.ActiveDocument.ActiveChannels= _
appRef.ActiveDocument.ComponentChannels
JS:
app.activeDocument.activeChannels =
activeDocument.componentChannels;
3.13.2 Other filters
If the filter type that you want to use on your layer is not part of the scripting interface, you can
use the Action Manager from a JavaScript to run a filter. If you are using AppleScript, Visual
Basic or VBScript, you can still run a JavaScript from your script.
3.14 Channel object
The Channel
object
(Channel/channel)
gives you access to much of the available
functionality on Photoshop channels. You can create, delete and duplicate channels or retrieve
a channel's histogram and change its kind or change the current channel selection.
3.14.1 Channel types
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.”
It’s important to keep the different types of channels in mind when writing scripts that work on
them.