Adobe 26001360 Scripting Guide - Page 123
Example 21.3, Object > Clipping Mask > Make
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 123 highlights
Adobe Illustrator CS Scripting Guide 123 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