Adobe Photoshop CS2 Scripting Guide
In the Adobe Photoshop CS2 Visual Basic Scripting Reference and the Adobe Photoshop CS2 JavaScript
●
Scripting Reference, look up selection in the Properties table for the
select
Creating and Defining a Selection
To create a selection, you use the
You define a
corners. Since your document is a 2-dimensional object, you specify coordinates using the x-and y-axes as
follows:
You use the x-axis to specify the horizontal position on the canvas.
●
You use the y-axis to specify the vertical position on the canvas.
●
The origin point in Photoshop CS2, that is, x-axis = 0 and y-axis = 0, is the upper left corner of the screen.
The opposite corner, the lower right, is the extreme point of the canvas. For example, if your canvas is 1000
x 1000 pixels, then the coordinate for the lower right corner is x-axis = 1000 and y-axis = 1000.
You specify coordinate points that describe the shape you want to select as an array, which then becomes
the argument or parameter value for the
➤
The following examples assume that the ruler units have been set to pixels and create a selection
by:
1. Creating a variable to hold a new document that is 500 x 500 pixels in size.
2. Creating a variable to hold the coordinates that describe the selected area (that is, the
object).
3. Adding an array as the selection variable's value.
4. Using the
command/method to select an area. The area's coordinates are the selection variable's values.
AS
set docRef to make new document with properties {height: 500 pixels, width:500
pixels}
set shapeRef to select current document region {{ 0, 0}, {0, 100}, ¬
select current document region shapeRef
VBS
DocRef = Documents.Add
ShapeRef = Array((0, 0), (0, 100), (100,100), (100,0))
docRef.Selection.Select ShapeRef
JS
var docRef = app.documents.add(500, 500)
var shapeRef = [
]
docRef.selection.select(shapeRef)
in the Methods table for the
object by specifying the coordinates on the screen that describe the selection's
Selection
object's
Document
selection
{ 100, 100}, { 100, 0}}
[0,0],
[0,100],
[100,100],
[100,0]
Photoshop CS2
object.
Selection
select/Select/select()
select/Select/select()
property, and the
Scripting Photoshop CS2
object. Also, look up the
Document
command/method of the
command/method.
object's
Selection
select
56
object.
Selection
Selection