Using Operators - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
3. Do either of the following:
If Photoshop CS2 is already open, choose File > Scripts > Browse, and then navigate to the Presets
> Scripts folder and choose your script.
Start or restart Photoshop CS2, and then choose File > Scripts, and then select your script from the
Scripts menu.
What's Next
The remainder of this chapter provides information about general scripting tips and techniques.
Experienced AppleScript writers and VBScript and JavaScript programmers may want to skip to Chapter 3,
Scripting Photoshop CS2

Using Operators

Operators perform operations on variables or values and return a result. In the following table, the
examples use the following variables:
thisNumber =10
thisString = "Pride"
Operator
+
-
*
/
=
+ (JS and
VBS only)
& (AS and
VBS only)
a.
Concatenation operations combine two strings. Note that a space has been added at the
beginning of the string " and Prejudice"; without the space following the first enclosing quote,
the result would be:
Prideand Prejudice
b.
See note a.
Comparison Operators
You can use a different type of operator to perform comparisons such as equal to, not equal to, greater
than, or less than. These are called comparison operators. Consult a scripting language guide, such as the
guides listed in this document's
for specifics on scripting Photoshop CS2.
Operation
add
subtract
multiply
divide
assign
a
concatenate
b
concatenate
'Bibliography' on page 34
Photoshop CS2
Example
+ 2
thisNumber
- 2
thisNumber
* 2
thisNumber
/2
thisNumber
= 10
thisNumber
+ " and
thisString
Prejudice"
& " and
thisString
Prejudice"
Result
12
8
20
5
10
Pride and Prejudice
Pride and Prejudice
, for information on comparison operators.
Scripting basics
25

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents