Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 66

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
Note:
This type of script corresponds to selecting Start Application in the Script Events Manager (File >
Scripts > Script Events Manager) in the Photoshop CS2 application. Please refer to Photoshop CS2
Help for information on using the Script Events Manager.
Using the PathItem Object
To add a
PathItem
the corners or anchor points of your path. Additionally, you can create an array of
contain the
The following script creates a
AS
--line #1--it's a straight line so the coordinates for anchor, left, and
--right for each point have the same coordinates
tell application "Adobe Photoshop CS2"
set ruler units of settings to pixel units
set type units of settings to pixel units
set docRef to make new document with properties {height:700, width:500,¬
set pathPointInfo1 to {class:path point info, kind:corner point,¬
set pathPointInfo2 to {class:path point info, kind:corner point,¬
set subPathInfo1 to {class:sub path info, entire sub path:{pathPointInfo1,¬
set newPathItem to make new path item in docRef with properties {entire path:¬
end tell
VBS
'line #1--it's a straight line so the coordinates for anchor, left, and
'right for each point have the same coordinates
Set lineArray(1) = CreateObject("Photoshop.PathPointInfo")
lineArray(1).Kind = 2 ' for PsPointKind --> 2 (psCornerPoint)
lineArray(1).Anchor = Array(100, 100)
lineArray(1).LeftDirection = lineArray(1).Anchor
lineArray(1).RightDirection = lineArray(1).Anchor
Set lineArray(2) = CreateObject("Photoshop.PathPointInfo")
lineArray(2).Kind = 2
lineArray(2).Anchor = Array(150, 200)
lineArray(2).LeftDirection = lineArray(2).Anchor
lineArray(2).RightDirection = lineArray(2).Anchor
Set lineSubPathArray(1) = CreateObject("Photoshop.SubPathInfo")
lineSubPathArray(1).operation = 2 'for PsShapeOperation --> 2 (psShapeXOR)
lineSubPathArray(1).Closed = false
lineSubPathArray(1).entireSubPath = lineArray
object, you create an array of
arrays.
PathPoint
PathItem
name:"Snow Cone"}
anchor:{100, 100}, left direction:{100, 100}, right direction:{100, 100}}
anchor:{150, 200}, left direction:{150, 200}, right direction:{150, 200}}
pathPointInfo2}, operation:shape xor, closed:false}
{subPathInfo1, subPathInfo2} kind:normal}
Photoshop CS2
PathPointInfo
object that is a straight line.
Scripting Photoshop CS2
objects, which specify the coordinates of
SubPathInfo
62
objects to

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents