EDOBE XDOM TPC Technical Information Page 61

  • Download
  • Add to my manuals
  • Print
  • Page
    / 68
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 60
CHAPTER 6: Scripting with VBScript Working with enumeration values 61
Creating a polygon
Consider the following sample:
Set appRef = CreateObject("Illustrator.Application")
Set frontDocument = appRef.ActiveDocument
' Create a new polygon with
' top = 144, left side = 288, width = 72, height = 144
Set newPolygon = frontDocument.PathItems.Polygon(144,288,72,7)
The sample creates a polygon with these properties:
X The center point of the object is inset 2 inches (144 points) on the horizontal axis and 4 inches
(288 points) on the vertical axis.
X The length of the radius from the center point to each corner is 1 inch (72 points).
X The polygon has 7 sides.
Working with enumeration values
Properties that use enumeration values in VBScript use a numeral rather than a text value. For example,
the
Orientation property of the TextFrame object specifies whether text content in the text frame is
horizontal or vertical. The property uses the
aiTextOrientation enumeration, which has two possible
values,
aiHorizontal and aiVertical.
To find the numeral values of enumerations, use either of the following:
X The object browser in your scripting editor environment. See Viewing the VBScript object model” on
page 10.
X The Adobe Illustrator CS5 Scripting Reference: VBScript, which lists the numeral values directly after the
constant value in the “Enumerations” chapter at the end of the book. The following example is from
that table:
The following sample specifies vertical text orientation:
Set appRef = CreateObject ("Illustrator.Application")
Set docRef = appRef.Documents.Add
Set textRef = docRef.TextFrames.Add
textRef.Contents = "This is some text content."
textRef.Left = 50
textRef.Top = 700
textRef.Orientation = 1
Generally, it is considered good scripting practice to place the text value in a comment following the
numeral value, as in the following sample statement:
textRef.Orientation = 1 ' aiVertical
Enumeration type Values What it means
AiTextOrientation aiHorizontal = 0
aiVertical = 1
The orientation of text in a text frame
Page view 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 67 68

Comments to this Manuals

No comments