Adobe 65010248 Scripting Guide - Page 39

Write-once access, Creating a rectangle, Creating a polygon

Page 39 highlights

CHAPTER 4: Scripting with AppleScript Creating paths and shapes 39 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. Creating a rectangle Consider the following sample: tell application "Adobe Illustrator" set docRef to make new document set rectRef to make new rectangle in docRef with properties {bounds:{288, 360, 72, 144}} end tell The sample creates a rectangle with these properties: ➤ The top-right corner of the of the rectangle is inset 4 inches (288 points) from the bottom of the page and 5 inches (360 points) from the left edge of the page. ➤ The lower-left corner of the rectangle is inset 1 inch (72 points) from the left edge of the page and 2 inches (144 points) from the bottom of the page. Creating a polygon Consider the following sample: tell application "Adobe Illustrator" set docRef to make new document set pathRef to make new polygon in docRef with properties {center point:{144, 288},sides:7,radius:72.0} end tell The sample creates a polygon with these properties: ➤ The center point of the object is inset is 2 inches (144 points) on the horizontal axis and 4 inches (288 points) on the vertical axis. ➤ The polygon has 7 sides. ➤ The length of the radius from the center point to each corner is 1 inch (72 points).

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57

C
HAPTER
4: Scripting with AppleScript
Creating paths and shapes
39
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.
Creating a rectangle
Consider the following sample:
tell application "Adobe Illustrator"
set docRef to make new document
set rectRef to make new rectangle in docRef with properties
{bounds:{288, 360, 72, 144}}
end tell
The sample creates a rectangle with these properties:
The top-right corner of the of the rectangle is inset 4 inches (288 points) from the bottom of the page
and 5 inches (360 points) from the left edge of the page.
The lower-left corner of the rectangle is inset 1 inch (72 points) from the left edge of the page and
2 inches (144 points) from the bottom of the page.
Creating a polygon
Consider the following sample:
tell application "Adobe Illustrator"
set docRef to make new document
set pathRef to make new polygon in docRef with properties
{center point:{144, 288},sides:7,radius:72.0}
end tell
The sample creates a polygon with these properties:
The center point of the object is inset is 2 inches (144 points) on the horizontal axis and 4 inches
(288 points) on the vertical axis.
The polygon has 7 sides.
The length of the radius from the center point to each corner is 1 inch (72 points).