Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 19

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
Using the Variable in a Script
After declaring and assigning values to your variables, you use the variables in your script to represent the
value; you use only the variable name without the
the
display dialog
display dialog thisString
Assigning an Object Reference as a Value
You can also use variables to store references to objects. (See
explanation of object references.) The following statement creates a variable named
its value, creates a new
referring to the new layer.
set thisLayer to make new art layer in current document
You can also assign a reference to an existing object as the value:
set thisLayer to art layer 1 of current document
AppleScript Value Types
You can use the following types of values for variables in your AppleScripts.
Note:
For now, don't worry about the value types you don't understand.
Value Type
boolean
integer
real
string
list
object
record
VBS
To create a variable in VBScript, you use the
statements create the variables
Dim thisNumber
Dim thisString
You can declare multiple variables in a single
as follows:
Dim thisNumber, thisString
Photoshop CS2
command to create a dialog box with the text Hello World.
object. When you use
Art Layer
What It Is
Logical true or false.
Whole numbers (no decimal
points). Integers can be positive
or negative.
A number that may contain a
decimal point.
A series of text characters.
Note:
Strings appear inside
(straight) quotation
marks.
An ordered list of values. The
values of a list may be any type.
A specific reference to an object. current document
An unordered list of properties,
Each property is identified by its
label.
Dim
and
thisNumber
Dim
or
command. The following statement uses
set
copy
'Object References' on page 11
thisLayer
Sample Value
true
14
13.9972
"I am a string"
{10.0, 20.0, 30.0, 40.0}
{name: "you", index: 1}
keyword at the beginning of the statement. The following
.
thisString
statement by separating the variables with a comma (,),
Scripting basics
thisLayer
in a script statement, you are
15
for an
and as

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents