Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting Photoshop CS2 68
VBS
In VBScript, you must use the
ArtLayer
or
Selection
object’s
Copy
method with the
Merge
parameter. To
perform the merged copy, you must enter, or
pass
, the value
true
, as in the following example.
docRef.Selection.Copy True
Look up the
Copy
method in the Methods table for the
ArtLayer
and
Selection
objects in the
Adobe
Photoshop CS2 Visual Basic Scripting Reference
,
JS
In JavaScript, you must use the
ArtLayer
or
Selection
object’s
copy()
method with the
merge
parameter. To perform the merged copy, you must enter, or
pass
, the value
true
, as in the following
example.
docRef.selection.copy(true)
Look up the
copy()
method in the Methods table for the
ArtLayer
and
Selection
objects in the
Adobe
Photoshop CS2 JavaScript Scripting Reference
,
Working with Units
Photoshop CS2 provides two rulers for documents. You can set the measurement units for the rulers in
your script. The rulers are:
●
A graphics ruler used for most graphical layout measurements or operations on a document where
height, width, or position are specified.
You set measurement unit types for the graphics ruler using the
ruler units
(RulerUnits/rulerUnits)
property.
●
A type ruler, which is active when using the type tool
You set measurement unit types for the type ruler using the
type units (TypeUnits/typeUnits)
property.
Note:
These settings correspond to those found in the Photoshop CS2 preference dialog under
Photoshop >Preferences > Units & Rulers
on Mac OS or
Edit >Preferences > Units & Rulers
in
Windows.
Unit Values
All languages support plain numbers for unit values. These values are treated as being of the type
currently specified for the appropriate ruler.
For example, if the ruler units are currently set to inches and the following VBScript statement sets a
document’s size to 3 inches by 3 inches:
docRef.ResizeImage 3,3
If the ruler units had been set to pixels, the document would be 3 pixels by 3 pixels. To ensure that your
scripts produce the expected results you should check and set the ruler units to the type appropriate for
your script. After executing a script the original values of the rule settings should be restored if changed in
the script. See
‘Setting Ruler And Type Units in a Script’ on page 71
for directions on setting
unit values.
Please refer to Photoshop CS2 Help for information about available unit value types.
Special Unit Value Types
The unit values used by Photoshop CS2 are length units, representing values of linear measurement.
Support is also included for pixel and percent unit values. These two unit value types are not, strictly
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...