Working With Layer Objects; Creating An Artlayer Object - Adobe 23102480 - Photoshop CS3 - PC Programming Manual

Scripting guide
Table of Contents

Advertisement

Adobe Photoshop CS3 Scripting Guide
JS
//save original ruler units, then assign it to inches
startRulerUnits = app.preferences.rulerUnits
app.preferences.rulerUnits = Units.INCHES
//get a reference to the file, and open it
var fileRef = new File(app.path + "/samples/ducky.tif")
var docRef = app.open(fileRef)
//this sample script assumes the ruler units have been set to inches
docRef.resizeImage( 4,4 )
docRef.resizeCanvas( 4,4 )
docRef.trim(TrimType.TOPLEFT, true, false, true, false)
//the crop command uses unit values
//so change the ruler units to pixels
app.preferences.rulerUnits =Units.PIXELS
docRef.crop (new Array(100,200,400,500), 45, 20, 20)
docRef.flipCanvas(Direction.HORIZONTAL)
//restore original preferences
app.preferences.rulerUnits = startRulerUnits

Working with Layer Objects

The Photoshop CS3 object model contains two types of layer objects:
ArtLayer
Photoshop CS3 application.
Note:
Layer Set
When you create a layer you must specify whether you are creating an
Note:
Both the
LayerSets
and
it does not have an

Creating an ArtLayer Object

The following examples demonstrate how to create an
the current document.
AS
tell application "Adobe Photoshop CS3"
make new document
make new art layer at beginning of current document ¬
select all current document
fill selection of current document with contents ¬
end tell
objects, which can contain image contents and are basically equivalent to Layers in the
An
object can also contain text if you use the
ArtLayer
object's type to text layer.
objects, which can contain zero or more
and
ArtLayer
LayerSet
, which have an
objects using the
LayerSet
add/Add/add()
with properties {name:"MyBlendLayer", blend mode:normal}
{class:RGB color, red:255, green:0, blue:0}
Photoshop CS3
ArtLayer
objects have corresponding collection objects,
command.You can reference, but not add,
add/Add/add()
collection object, because, unlike other collection objects,
Layers
command.
ArtLayer
Scripting Photoshop CS3
property to set the
kind
objects.
or a
ArtLayer
Layer Set
ArtLayers
object filled with red at the beginning of
34
ArtLayer
.
and
ArtLayer

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 23102480 - Photoshop CS3 - PC and is the answer not in the manual?

This manual is also suitable for:

13102498 - photoshop cs3 - macPhotoshop cs3

Table of Contents