Adobe 26001360 Scripting Guide - Page 122
Example 21.1, File > Place
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 122 highlights
122 AppleScript Reference command. The resulting group will be the same object as if the user had placed the file from the user interface using the File > Place... command with the embed checkbox checked. Example 21.1 Create a new group item from the contents of a vector art file, either EPS or PDF. -- Create a new group whose contents will be the contents of a vector art file -- fileRef is an alias or file reference to the vector file to be placed on EmbedVectorFile(fileRef) tell application "Illustrator CS" set groupRef to make new group item in document 1 with data fileRef ¬ with properties {position:{0, 600}} end tell return groupRef end EmbedVectorFile -- Call handler set fileRef to choose file with prompt "Select vector file to place" set groupRef to EmbedVectorFile(fileRef) Example 21.2 New groups can be easily created and populated with objects. This example demonstrates how path items can be created in a container group. -- Create a new group, then add rectangles to it using -- the available placement options tell application "Illustrator CS" set groupRef to make new group item in document 1 set rectRef to make new rectangle at beginning of groupRef with properties ¬ {bounds:{150, 550, 350, 350}, fill color:{blue:255}} make new rectangle after rectRef with properties ¬ {bounds:{100, 600, 300, 400}, fill color:{red:255}} set rectRef to make new rectangle at end of groupRef with properties ¬ {bounds:{0, 700, 200, 500}, fill color:{green:255}} make new rectangle before rectRef with properties ¬ {bounds:{50, 650, 250, 450}, fill color:{black:100}} end tell 12 Aug 03