Adobe 26001360 Scripting Guide - Page 210
Example 55.2, The values in a, can be used in a number of ways in a script.
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 210 highlights
210 AppleScript Reference Example 55.2 The values in a rectangle can be used in a number of ways in a script. tell application "Illustrator CS" -- Get the bounds of a page item set itemBounds to geometric bounds of page item 1 of document 1 --> {100.0, 400.0, 300.0, 200.0} -- Assigns the four values in a rectangle point to four variables set {l, t, r, b} to itemBounds --> l = 100.0, t = 400.0, r = 300.0, b = 200.0 -- or assign to four variables directly set {l, t, r, b} to geometric bounds of page item 1 of document 1 --> l = 100.0, t = 400.0, r = 300.0, b = 200.0 -- Calculate center of page item from its bounds set xCenter to ((item 1 of itemBounds) + (item 3 of itemBounds)) / 2 set yCenter to ((item 2 of itemBounds) + (item 4 of itemBounds)) / 2 --> xCenter = 200.0, yCenter = 300.0 -- or calculate the center using the individual coordinate variables set xCenter to (l + r) / 2 set yCenter to (t + b) / 2 --> xCenter = 200.0, yCenter = 300.0 -- Change the left value in a fixed rectangle set item 1 of itemBounds to (item 1 of itemBounds) + 100.0 --> {200.0, 400.0, 300.0, 200.0} end tell 12 Aug 03