Adobe 26001360 - Illustrator CS - PC Manual page 99

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

Adobe Illustrator CS Scripting Guide
or class of selectedItems is text ¬
or class of item 1 of selectedItems is not path item then
display dialog "Please select a single path item before running this script"
else
set pathItem to item 1 of selectedItems
-- Set ellipse color based on document color space
set docColorSpace to color space of current document
if docColorSpace is RGB then
set ellipseColor to {red:255.0, green:0.0, blue:0.0}
else
set ellipseColor to {cyan:0.0, magenta:100.0, yellow:100.0, black:0.0}
end if
-- Gather needed info about the path item to be embellished
set itemWidth to width of pathItem
set itemHeight to height of pathItem
set pathPointList to anchor of every path point of pathItem
-- Calculate the position and bounds for each ellipse
repeat with aPoint in pathPointList
set {x, y} to aPoint
set rectLeft to x - (itemWidth * pEllipseScale)
set rectRight to x + (itemWidth * pEllipseScale)
set rectTop to y + (itemHeight * pEllipseScale)
set rectBottom to y - (itemHeight * pEllipseScale)
set ellipseRect to {rectLeft, rectTop, rectRight, rectBottom}
make new ellipse at beginning of current document ¬
with properties {bounds:ellipseRect, inscribed:true ¬
, reversed:false, stroke color:ellipseColor, fill color:ellipseColor} ¬
end repeat
end if
end tell
12 Aug 03
99

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents