Unit Value Usage - Adobe 23102480 - Photoshop CS3 - PC Programming Manual

Scripting guide
Table of Contents

Advertisement

Adobe Photoshop CS3 Scripting Guide
When this script is run, the variable
inches. This conversion ability is built in to the AppleScript language.
Note:
The unit values
to
Using Unit Values in Calculations
To use a unit value in a calculation in Applescript it is necessary to first convert the value to a number (unit
value cannot be used directly in calculations). To multiply an inch value write:
set newValue to (inchValue as number) * 5
Note:
In AppleScript you can get and set values as pixels or percent as you would any other unit value
type. You cannot, however, convert a pixel or percent value to another length unit value as you can
with other length value types. Trying to run the following script will result in an error.
set pixelValue to 72 as pixels
-- Next line will result in a coercion error when run
set inchValue to pixelValue as inches
Note:
Because Photoshop CS3 is a pixel-oriented application you may not always get back the same value
as you pass in when setting a value. For example, if
a document that is 30 x 30, the value returned for the height or width will be 30.056 if your
document resolution is set to 72 ppi. The scripting interface assumes settings are measured by ppi.

Unit Value Usage

The following tables list the properties of the classes/objects that are defined to use unit values. Unit
values for these properties, unless otherwise indicated in the table, are based the graphics ruler setting.
To use this table, do one of the following:
Look up the properties of the class in the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the
Photoshop CS3 AppleScript Dictionary.
Look up the property of the object in the Adobe Photoshop CS3 Visual Basic Scripting Reference, the
Adobe Photoshop CS3 JavaScript Scripting Reference, the Visual Basic Object Browser, or the ExtendScript
Object Model Viewer.
Class/Object
Document
EPS open options
PDF open options
lens flare open
options
cm units
or
. They are not supported by the AppleScript terminology.
cm
mm
AppleScript
Properties
height
width
height
width
height
width
height
width
Photoshop CS3
will contain inches 1, which is 72 points converted to
inchValue
and
cannot be used in this way with a corresponding reference
mm units
VBScript
Properties
Height
Width
Height
Width
Height
Width
Height
Width
Scripting Photoshop CS3
is set to mm units, and you create
ruler units
JavaScript
Properties
height
width
height
width
height
width
height
width
57

Advertisement

Table of Contents
loading

This manual is also suitable for:

13102498 - photoshop cs3 - macPhotoshop cs3

Table of Contents