Adobe 26001360 - Illustrator CS - PC Manual page 68

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

Advertisement

68
-- Check for selection of single non-text object
if class of selectedItems is text or (count items of selectedItems) is not 1 then
display dialog "Select a single path item before running this script"
else
tell application "Illustrator CS"
set pathItem to item 1 of selectedItems
-- Get the item's position and use it to tile the new items below
set {itemX, itemY} to position of pathItem
-- Get a list of all brushes and apply each brush to the selectec item
set brushList to every brush of current document
-- Get coordinates of upper-left of document
set docLeft to 0
set docTop to height of current document
set brushCount to count items of brushList
repeat with i from 1 to brushCount
set aBrush to item i of brushList
set itemOffset to i * 20 -- use to tile the duplicated items
-- Duplicate the selected path item, tiling them from the
-- upper-left of the document
set pathRef to duplicate pathItem to beginning of current document ¬
with properties {position:{docLeft + itemOffset, docTop - itemOffset}}
-- Must clear the document's selection before applying a brush
-- since the duplicate above seems to add to it each time through
set selection of current document to {}
apply aBrush to pathRef
end repeat
end tell
end if
12 Aug 03
AppleScript Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents