EDOBE XDOM TPC Technical Information Page 38

  • Download
  • Add to my manuals
  • Print
  • Page
    / 68
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 37
CHAPTER 4: Scripting with AppleScript Creating paths and shapes 38
Threaded frames make one story object
Threaded frames make a single story object. To observe this, run the following AppleScript after running
the script in
Threaded frames” on page 37.
display dialog ("There are " & (count(text frames of current document)) & " text frames.")
display dialog("There are " & (count(stories of current document)) & " stories.")
Creating paths and shapes
This section explains how to create items that contain paths.
Paths
To create line or a freeform path, specify a series of path points, as a series of x-y coordinates or path point
objects.
Using x-y coordinates limits the path to straight segments. To created a curved path, you must create
path point objects. A path can comprise a combination of page coordinates and path point objects.
Specifying a series of x-y coordinates
To specify a path using page-coordinate pairs, use the entire path property of the path items object.
The following script specifies three pairs of x-y coordinates, to create a path with three points:
tell application "Adobe Illustrator"
set docRef to make new document
-- set stroked to true so we can see the path
set lineRef to make new path item in docRef with properties {stroked:true}
set entire path of lineRef to {{220, 475},{200, 300},{375, 300}}
end tell
Using path point objects
To create a path point object, you must define three values for the point.
X A fixed anchor point, which is the point on the path.
X A pair of direction points—left direction and right direction—which allow you to control the
path segments curve.
You define each property as an array of page coordinates in the format [x, y]:
X If all three properties of a path point object have the same coordinates, and the properties of the next
path point in the line are equal to each other, you create a straight-line segment.
X If two or more properties in a path point object have different values, the segment connected to the
point is curved.
To create a path or add points to an existing path using
path point objects, create a path item object,
then add the path points as child objects in the
path item:
tell application "Adobe Illustrator"
set docRef to make new document
Page view 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 67 68

Comments to this Manuals

No comments