Adobe 23101335 Scripting Guide - Page 74
Working with Filters, 3.12.1 Selecting channel(s) to filter
UPC - 718659152833
View all Adobe 23101335 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 74 highlights
Scripting Photoshop 3 Working with Filters 3.12 Working with Filters To apply a filter, use the layer's filter command for AppleScript or the ApplyXXX/applyXXX methods for Visual Basic and JavaScript. The following examples apply the Gaussian blur filter to the active layer. AS: filter current layer of current document using Gaussian blur ¬ with options { radius: 5 } VB: docRef.ActiveLayer.ApplyGaussianBlur 5 JS: docRef.activeLayer.applyGaussianBlur(5); 3.12.1 Selecting channel(s) to filter When applying filters, keep in mind they affect the selected channels of a visible layer. This means that prior to running a filter, you may have to set the active channels. Since more than one channel can be active at a time, you must provide an array of channels when setting a channel. The code below demonstrates how to set the active channels to the channels named "Red" and "Blue." AS: set current channels of current document to { channel "Red" of ¬ current document, channel "Blue" of current document } 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 Photoshop 7.0 Scripting Guide 74