Setting The Active Layer - Adobe 65014912 Manual

Photoshop cs4 extended
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER
JS
// Create 2 documents
var docRef = app.documents.add( 4, 4)
var otherDocRef = app.documents.add (4,6)
//make docRef the active document
app.activeDocument = docRef
//here you would include command statements
//that perform actions on the active document. Then, you could
//make a different document the active document
//use the activeDocument property of the Application object to
//bring otherDocRef front-most as the new active document
app.activeDocument = otherDocRef

Setting the active layer

The following examples demonstrate how to use the
property of the
document itself must be the current document.
AS
set current layer of current document to layer "Layer 1" of current document
N
: By default, Photoshop names the layers "Layer 1", "Layer2", etc.
OTE
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
Scripting Reference, or in the Visual Basic Object Browser.
N
: You can also use the name of the layer to indicate which layer to use. By default, Photoshop names
OTE
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
Scripting Reference, or in the ExtendScript Object Model Viewer.
N
: You can also use the name of the layer to indicate which layer to use. By default, Photoshop names
OTE
the layers "Layer 1", "Layer2". See
object to set the active layer. In order to set the active layer for a document, the
Document
property on the
ActiveLayer
"Referencing ArtLayer objects" on page
property on the
activeLayer
"Referencing ArtLayer objects" on page
current layer (ActiveLayer/activeLayer)
object in the Adobe Photoshop CS4 Visual Basic
Document
object in the Adobe Photoshop CS4 JavaScript
Document
Setting the Active Object 27
38.
38.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents