Using Object Properties - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
script a year after you write it, such as
that they'll stand out from the objects, commands, and keywords of your scripting system. For example,
you could use the prefix "doc" at the beginning of any variables that contain
to identify variables that contain
Variable names must be a single word (no spaces). Many people use internal capitalization (such as
myFirstPage
Variable names cannot begin with a number or contain punctuation or quotation marks.
You can use underscore characters ( _ ), but not as the first character in the name.
Variable names in JavaScript and VBScript are case sensitive.
thisstring
Variable names in AppleScript are not case sensitive.

Using Object Properties

Properties describe an object. For example, a
document's size.
To access and modify a property of an object, you name the object and then name the property. The
specific syntax varies by language. The following examples use the kind property of the
to make the layer a text layer.
AS
You can specify properties using
properties in brackets ({ }). Within the brackets, you name the property and then type a colon (:) and the
property definition after the colon, as in the following sample.
make new art layer with properties {kind:text}
VBS
In VBScript, you use an object's property by naming the object, then typing a period (.), and then typing
the property. Use the equals sign (=) to set the property value.
Set layerRef toArtLayers.Add
layerRef.Kind = 2
Note:
The
rather than the text version of the value. To find constant values, refer to the "Constants' chapter in
the appropriate scripting reference. For more information, see
Constants' on page 19
JS
In JavaScript, you name the object, type a period (.), and then name the property, using the equals sign (=)
to set the property value.
var layerRef = artLayers.add()
layerRef.kind = LayerKind.TEXT
Note:
The
JavaScript, you must use constant values exactly as they appear in the scripting language reference.
To find constant values, refer to the "Constants' chapter in the appropriate scripting reference. For
more information, see
Art Layer
) or underscore characters (
or
.
ThisString
with properties
property value, 2, is a constant value. VBScript uses the enumerated constant values
Kind
.
property in JavaScript uses a constant value indicated by the upper case formatting. In
kind
'Understanding and Finding Constants' on page 19
Photoshop CS2
or
. You can also give your variable names a standard prefix so
x
c
objects.
my_first_page
object's height and width properties describe the
Document
at the end of the statement and enclosing the
Document
) to create more readable names.
is not the same as
thisString
'Understanding and Finding
Scripting basics
18
objects, or "layer"
object
ArtLayer
.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents