Adobe 23101764 - Photoshop CS - PC Manual page 62

Scripting guide
Hide thumbs Also See for 23101764 - Photoshop CS - PC:
Table of Contents

Advertisement

appropriate for your script. After executing a script the original values of the rule settings
should be restored if changed in the script. See section
on page 61
AppleScript unit considerations
AppleScript provides an additional way of working with unit values. You can provide values
with an explicit unit type where unit values are used. When a typed value is provided its type
overrides the ruler's current setting.
For example, to create a document which is 4 inches wide by 5 inches high you would write:
make new document with properties {width:inches 4, ¬
The values returned for a Photoshop property which used units will be returned as a value of
the current ruler type. Getting the height of the document created above:
set docHeight to height of current document
would return a value of 5.0, which represents 5 inches based on the current ruler settings.
In AppleScript, you can optionally ask for a property value as a particular type.
set docHeight to height of current document as points
This would return a value of 360 (5 inches x 72 points per inch).
IMPORTANT:
The length unit value types available AppleScript use are listed below:
T
ABLE
inches
feet
yards
miles
points
traditional points
ciceros
Photoshop CS Scripting Guide
for directions on setting unit values.
height:inches 5}
Because Photoshop 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 Ruler
Units is set to mm units, and you create 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.
3.1
AppleScript Length Unit Values
3.6.3, "Changing ruler and type units"
millimeters
centimeters
meters
kilometers
picas
traditional picas
Scripting Photoshop
Working with units
3
58

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs

Table of Contents