Adobe 26001360 Scripting Guide - Page 165
Example 35.1, class has additional properties that other related classes do not share
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 165 highlights
Adobe Illustrator CS Scripting Guide 165 The paragraph class has additional properties that other related classes do not share, including properties for margins, tab stop settings, hyphenation, and word/letter spacing. Example 35.1 The hyphenation of all text can be quickly changed from a script, as this example shows. -- Enable hyphenation for every paragraph of the current document tell application "Illustrator CS" if (count text frames of document 1) > 0 then set itemCounter to count text frames of document 1 repeat with i from 1 to itemCounter set hyphenation of (every paragraph of text frame i of document 1) to true end repeat end if end tell Example 35.2 -- Paragraph Attributes --- Make a new document -- Make a rectangle -- Make an text frame of kind area text and assign the previously made rectangle as it's path -- Set the contents of the text frame to some text containing three paragraphs -- Resize and justify the paragraphs -- tell application "Illustrator CS" activate make new document make new rectangle in document 1 with properties {position:{100, 400}, width:400, height:200} set areaText to make new text frame in document 1 with properties {kind:area text, text path:the result} set theParagraph to "Left justified paragraph." & return & "Center justified paragraph." & return & "Right justified paragraph." set the contents of areaText to theParagraph set the size of the text of areaText to 28 set the justification of paragraph 1 of areaText to left set the justification of paragraph 2 of areaText to center set the justification of paragraph 3 of areaText to right end tell 12 Aug 03