EDOBE XDOM TPC Technical Information Page 39

  • Download
  • Add to my manuals
  • Print
  • Page
    / 68
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 38
CHAPTER 4: Scripting with AppleScript Creating paths and shapes 39
-- set stroked to true so we can see the path
set lineRef to make new path item in docRef with properties {stroked:true}
--giving the direction points the same value as the
--anchor point creates a straight line segment
set newPoint to make new path point of lineRef with properties ?
{anchor:{220, 475},left direction:{220, 475},right direction:{220, 475},
point type:corner}
set newPoint2 to make new path point of lineRef with properties ?
{anchor:{375, 300},left direction:{375, 300},right direction:{375, 300},
point type:corner}
--giving the direction points the different values
--creates a curve
set newPoint3 to make new path point of lineRef with properties ?
{anchor:{220, 300},left direction:{180, 260},right direction:{240, 320},
point type:corner}
end tell
Combining path point types
The following script sample creates a path with three points, by combining the entire path property with a
path point object:
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},{375, 300}}
set newPoint to make new path point of lineRef with properties ?
{anchor:{220, 300},left direction:{180, 260},right direction:{240, 320},
point type:corner}
end tell
Shapes
To create a shape, you use the object that corresponds to the shapes name (like ellipse, rectangle, or
polygon), and use the object’s properties to specify the shape’s position, size, and other information like
the number of sides in a polygon.
Remember:
X The scripting engine processes all measurements and page coordinates as points. For details, see
Measurement units” on page 30.
X x and y coordinates are measured from the bottom-left corner of the document, as indicated in the
Info panel in the Illustrator application. For details, see
Page-item positioning and dimensions” on
page 30.
Write-once access
Properties for path-item shapes use the “write-once” access status, which indicates that the property is
writeable only when the object is created. For existing path-item objects, the properties are read-only
properties whose values cannot be changed.
Page view 38
1 2 ... 34 35 36 37 38 39 40 41 42 43 44 ... 67 68

Comments to this Manuals

No comments