220
Example 63.1
-- Story
--
-- Make a new document
-- Make two text frames
-- Set the previous frame of the second text frame to text frame 1
-- Add a story to text frame 1 (long enough to overflow to text frame 2
-- Count the number of stories
-- Add a new text frame
-- Count the number of stories
--
tell application "Illustrator CS"
activate
make new document
make new rectangle in document 1 with properties {position:{200, 600},
height:30, width:50}
make new text frame in document 1 with properties {name:"Text1", kind:area
text, text path:the result}
make new rectangle in document 1 with properties {position:{300, 550},
height:200, width:50}
make new text frame in document 1 with properties {name:"Text2", kind:area
text, text path:the result}
set previous frame of text frame "Text2" of document 1 to text frame "Text1" of
document 1
set the contents of text frame "Text1" of document 1 to "This is two text
frames linked together as one story"
set user interaction level to interact with all
display dialog "Number of Stories in Document: " & (count stories of document
1) as string
make new rectangle in document 1 with properties {position:{200, 300},
height:30, width:150}
make new text frame in document 1 with properties {name:"Text3", kind:area
text, text path:the result}
set the contents of text frame "Text3" of document 1 to "Each unlinked
textFrame adds a new story"
display dialog "Number of Stories in Document: " & (count stories of document
1) as string
set user interaction level to never interact
end tell
12 Aug 03
AppleScript Reference