Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 53

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
VBS
'this script sample assumes the ruler units have been set to inches
docRef.ResizeImage 4,4
docRef.ResizeCanvas 4,4
docRef.Trim Type:=psTopLeftPixel, Top:=True, Left:=False, _
Bottom:=True, Right:=False
'the crop command uses unit values
'change the ruler units to pixels
app.Preferences.RulerUnits = Photoshop.PsUnits.psPixels
docRef.Crop Array(10,20,40,50), Angle:=45, Width:=20, _
Height:=20, Resolution:=72
docRef.FlipCanvas psHorizontal
JS
//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
//change the ruler units to pixels
app.preferences.rulerUnits =Units.PIXELS
docRef.crop (new Array(10,20,40,50), 45, 20, 20, 72)
docRef.flipCanvas(Direction.HORIZONTAL)
Working with Layer Objects
The Photoshop CS2 object model contains two types of layer objects:
ArtLayer
Photoshop CS2 application.
Note:
Layer Set
When you create a layer you must specify whether you are creating an
Note:
Both the
LayerSets
ArtLayer
collection objects, it does not have an
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
and
objects using the
LayerSet
Photoshop CS2
ArtLayer
objects have corresponding collection objects,
command/method.You can reference, but not add,
add/Add/add()
Layers
add/Add/add()
Scripting Photoshop CS2
property to set the
kind
objects.
ArtLayer
collection object, because, unlike other
command/method.
49
ArtLayer
or a
.
Layer Set
and
ArtLayers

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents