Using The Pathitem Object - Adobe 65048332 Manual

Scripting guide
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER
N
: Notification generally does not take effect on events that occur inside of a script, because these
OTE
events are embedded with in an
AS
tell application "Adobe Photoshop CS5"
try
delete notifiers
end try
make new notifier with properties {event:"Opn ", ¬
end tell
VBS
Dim appRef,eventFile
Set appRef = CreateObject("Photoshop.Application")
appRef.NotifiersEnabled = True
eventFile = appRef.Path & "Presets\Scripts\Event Scripts Only\Welcome.jsx"
appRef.Notifiers.Add "Opn ", eventFile
JS
app.notifiersEnabled = true
var eventFile = new File(app.path +
app.notifiers.add("Opn ", eventFile)

Using the PathItem object

To create a
document. This requires that you first create an array of
coordinates of the corners or anchor points of your path. Then you create an array of
to 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 CS5"
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, ¬
name:"Snow Cone"}
set pathPointInfo1 to {class:path point info, kind:corner point, ¬
anchor:{100, 100}, left direction:{100, 100}, right direction:{100, 100}}
set pathPointInfo2 to {class:path point info, kind:corner point, ¬
anchor:{150, 200}, left direction:{150, 200}, right direction:{150, 200}}
set subPathInfo1 to ¬
{class:sub path info, ¬
entire sub path:{pathPointInfo1, pathPointInfo2}, ¬
operation:shape xor, closed:false}
set newPathItem to make new path item in docRef with properties ¬
{entire path:{subPathInfo1}, name:"Line", kind:normal}
end tell
"AdobeScriptAutomation Scripts"
event file:alias "OS X 10.5.8 US:Users:psauto:Desktop:Welcome.jsx"}
"/Presets/Scripts/Event Scripts Only/Welcome.jsx")
object, you must add a
PathItem
arrays.Once you have the points and a subpath, you can add a new
PathPoint
PathItem
to the
PathItem
PathItems
PathPointInfo
object that is a straight line.
Working with the Photoshop Object Model 49
event.
element or collection for a
objects, which specify the
SubPathInfo
objects
.
PathItem

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

65048599Photoshop cs5

Table of Contents