EDOBE XDOM TPC Technical Information Page 22

  • Download
  • Add to my manuals
  • Print
  • Page
    / 68
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 21
CHAPTER 2: The Illustrator Scripting Object Model Text objects 22
Color objects
Your script can apply a color, pattern or gradient to a path item object, using the fill color or
stroke color properties:
X Scripts can define new color swatches using the make command or add method of the swatches
object. Your script also can create a new spot color, using the
make command or add property of the
spots object.
X You can define the attributes of an ink object using the ink info object, which is an ink object
property. You access
ink objects through the ink list property of the document object.
The following objects allow you to create colors within defined color spaces:
X The RGB color object, using the range 0.0 to 255.0 for the each of the three individual color values.
X The CMYK color object, using the percentage values 0.0 through 100.0 for each of the four individual
color values.
X The grayscale color or LAB color objects, using the same range and number of values that you use
in the Illustrator application.
Text objects
When you type content in an Illustrator document, the type automatically becomes a text frame object
and, at the same time, a
story object.
To observe this, open a new document in Illustrator and use the horizontal text tool to type some text,
then use the vertical text tool to type more text. Finally, create a rectangle and type some text inside it.
Now run the following JavaScript script:
var myDoc = app.activeDocument
alert("There are " + myDoc.textFrames.length + " text frames.")
alert("There are " + myDoc.stories.length + " stories.")
Text frames
There are three types of text frames:
X point
X area
X path
Page view 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 67 68

Comments to this Manuals

No comments