Adobe 26001360 Scripting Guide - Page 68
Duplicate the selected path item, tiling them from
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 68 highlights
68 AppleScript Reference -- 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