Adobe 26001360 - Illustrator CS - PC Manual page 123

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

Advertisement

Adobe Illustrator CS Scripting Guide
Example 21.3
This example demonstrates how to select all of the page items in a document that are not part
of a group by testing the container property of all items with a whose clause.
-- Select only the page items in a document that are not part of
-- a group and that are not themselves groups
tell application "Illustrator CS"
-- First deselect everything in the document
set selection of current document to {}
if (count page items of current document) > 0 then
set layerCount to count layers in current document
repeat with i from 1 to layerCount
set layerRef to layer i of current document
if (count page items of layer i of current document) > 0 then
set selected of (every page item of current document ¬
whose container is layerRef ¬
and class is not group item) to true
end if
end repeat
end if
end tell
Example 21.4
This example shows how to create a clipping mask using the first path item in a group item.
This is the same effect as you get when you use the Object > Clipping Mask > Make command
in the user interface.
-- Create a group of paths, then clip the group to the first path in the group
tell application "Illustrator CS"
-- Create a group to contain the paths to be clipped
set groupRef to make new group item in document 1
-- Add some path items to the group
make new rectangle at end of groupRef with properties ¬
{bounds:{200, 350, 300, 250}, fill color:{cyan:100}, stroked:false}
make new rectangle at end of groupRef with properties ¬
{bounds:{300, 250, 400, 150}, fill color:{magenta:100}, stroked:false}
make new rectangle at end of groupRef with properties ¬
{bounds:{300, 350, 400, 250}, fill color:{yellow:100}, stroked:false}
12 Aug 03
123

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents