Adobe 26001360 Scripting Guide - Page 75
Example 3.1, property has all of the properties
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 75 highlights
Adobe Illustrator CS Scripting Guide 75 Example 3.1 In the example below, the selection property has all of the properties that character or any other text class would have. -- Make the currently selected text superscript tell application "Illustrator CS" -- Make sure one or more characters of text are selected set selectedText to selection of current document if class of selectedText is text or ¬ class of selectedText is character then -- Adjust the properties of the selected text to superscript it set fontSize to size of selectedText set fontBaseline to baseline shift of selectedText set properties of selectedText to ¬ {size:fontSize / 2, baseline shift:fontBaseline + (fontSize / 2)} end if end tell Example 3.2 This example demonstrates how to use character properties to create unique effects from a script. (* Distort every character in the first text frame of a document by incrementally modifying the horizontal scaling of each character to give the effect of stretching words out *) -- A smaller value for this property means more difference between largest and -- smallest horizontal scaling of the characters property pVariability : 1.0 tell application "Illustrator CS" -- Is there is a document and a text frame to work with if (exists text frame 1 of current document) then -- Make sure the text frame contains some text set textFrame to first text frame of current document if textFrame is not "" then -- contains some text -- Gather info needed to calculate the scale factor 12 Aug 03