Adobe 26001360 - Illustrator CS - PC Manual page 131

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

Advertisement

Adobe Illustrator CS Scripting Guide
string value is to insert the string in the text frame at the insertion point's location. Setting the
contents to an empty string has no affect.
Example 24.1
This example shows several ways of working with insertion points.
tell application "Illustrator CS"
-- Set insertion point karat to beginning of a text frame
set selection to insertion point 1 of text frame 1 of document 1
-- Add a string to end of a text frame
set contents of insertion point -1 of text frame 1 of document 1 ¬
to " Some new text."
-- Since the default type of an insertion point is string, asking for
-- a particular insertion point returns its contents. To get a reference
-- to an insertion point you need to ask for a reference
set insertionRef to ¬
insertion point after word 3 of text frame 1 of document 1 as reference
set contents of insertionRef to " more words"
end tell
Example 24.2
-- Insertion Points
--
-- Make a new document
-- Make a new text frame with contents "Wouldn't you rather be scripting?"
-- Change the size of the text frame
-- Get the insertion points of the last word of the text frame
-- Add a new word at the first insertion point of the result
--
tell application "Illustrator CS"
activate
make new document
make new text frame in document 1 with properties {contents:"Wouldn't you
rather be scripting?", position:{100, 400}}
set the size of the text of the result to 20
delay 1
get insertion points of the last word of text frame 1 of document 1
make new word at (item 1 of the result) with properties
{contents:"AppleScript"}
end tell
12 Aug 03
131

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents