Adobe Smoke Alarm CS3 Manual De Usuario

Descargar
Página de 85
Photoshop CS3
Adobe Photoshop CS3  Scripting Guide
 Scripting Photoshop CS3     25
Setting the Active Layer
The following examples demonstrate how to use the 
current layer (ActiveLayer/activeLayer)
 
property of the 
Document
 object to set the active layer. In order to set the active layer for a document, the 
document itself must be the current document.
AS
set current layer of current document to layer “Layer 1” of current document
Note:
By default, Photoshop names the layers “Layer 1”, “Layer2”, etc. 
VBS
‘ This example assumes appRef and docRef have been previously defined and assigned
‘ to the application object and a document object that contains at least one layer.
appRef.ActiveDocument = docRef
docRef.ActiveLayer = docRef.Layers(1)
Look up the 
ActiveLayer
 property on the 
Document
 object in the Adobe Photoshop CS3 Visual Basic 
Scripting Reference, or in the Visual Basic Object Browser.
Note:
You can also use the name of the layer to indicate which layer to use. By default, Photoshop names 
the layers “Layer 1”, “Layer2”. See 
JS
// This example assumes docRef has been previously defined and assigned to a 
// document object that contains at least one layer.
activeDocument = docRef
docRef.activeLayer = docRef.layers[0]
Look up the 
activeLayer
 property on the 
Document
 object in the Adobe Photoshop CS3 JavaScript 
Scripting Reference, or in the ExtendScript Object Model Viewer. 
Note:
You can also use the name of the layer to indicate which layer to use. By default, Photoshop names 
the layers “Layer 1”, “Layer2”. See 
Setting the Active Channels
More than one channel can be active at a time, so the current channels 
(ActiveChannels/activeChannels) property of the Document object takes an array of channels 
as a value. In order to set the active channels of a document, it must be the active document.
AS
Set the active channels to the first and third channel using a channel array:
set current channels of current document to ¬
{ channel 1 of current document, channel 3 of current document }
Alternatively, select all component channels using the 
component channels
 property of the 
Document
 
object.
set current channels of current document to component channels ¬
of current document
VBS
Set the active channels of the active document to the first and third channel using a channel array: