Adobe 26001360 - Illustrator CS - PC Manual page 233

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

Advertisement

Adobe Illustrator CS Scripting Guide
It is not necessary to set the type of the content variable before binding. Illustrator
automatically sets the type to be the same as the page item to which it is bound.
Example 71.1
This script scales only text frames that are area text, which means they are rectangular
regions of text.
-- Scale all area text frames to 50% wide
tell application "Illustrator CS"
set textArtItemCount to count text frames in document 1
repeat with itemCount from 1 to textArtItemCount
set textKind to kind of text frame itemCount of document 1
if (textKind = area text) then
set curwidth to the width of text frame itemCount of document 1
set width of text frame itemCount of document 1 to curwidth / 2
end if
end repeat
end tell
Example 72.1
-- Text Frames
--
-- Make a new document
-- Make one text frame for each type: Area, Point, and Path
-- Display the count of text frames
-- Change the contents of each text frame
-- Delete the point text frame
-- Display the count of text frames
--
tell application "Illustrator CS"
activate
make new document
make new rectangle in document 1 with properties {position:{100, 700},
height:100, width:100}
make new text frame in document 1 with properties {name:"AreaText", kind:area
text, text path:the result, contents:"Text Frame 1"}
set pathPoint1 to {class:path point info, anchor:{250, 700}}
set pathPoint2 to {class:path point info, anchor:{350, 550}}
make new path item in document 1 with properties {entire path:{pathPoint1,
pathPoint2}}
make new text frame in document 1 with properties {name:"PathText", kind:path
text, text path:the result, contents:"Text Frame 2"}
12 Aug 03
233

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents