Adobe 26001360 Scripting Guide - Page 465
Example 89.1, Table 5.170, TextRange - Methods Continued
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 465 highlights
Adobe Illustrator CS Scripting Guide 465 Table 5.170 TextRange - Methods (Continued) Method Returns DeSelect() Duplicate( [relativeObject As Object], [insertionLocation As ElementPlacement] ) Move( relativeObject as Object, insertionLocation as ElementPlacement) Select(AddToDocument) TextRange Nothing What it does Deselect the text range Duplicate an art item, optionally specifying the location and position for the copy Move an art item, specifying the new location and position. Selects the text range Example 89.1 Dim appRef As New Illustrator.Application Dim textArt As Illustrator.TextFrame Dim textArtRange As Illustrator.TextRange Dim textWord As Illustrator.Word Dim wordLen As Integer Dim charsToChange As Integer Dim firstChars As Illustrator.TextRange For Each textArt In appRef.ActiveDocument.TextFrames Set textArtRange = textArt.TextRange For Each textWord In textArtRange.Words 'For each word we check to see if it is longer than 2 characters 'if it is we'll resize the first 2 characters 'if it is no we'll resize the whole word wordLen = Len(textWord.Contents) If (wordLen < 2) Then charsToChange = wordLen Else charsToChange = 2 End If If (charsToChange > 0) Then 'Here we are obtaining a sub range. By leaving the 'first argument out, we say: From the beginning to 12 Aug 03