AppleScript - what are bounds?
-
27-10-2019 - |
题
I am AppleScripting Adobe Illustrator CS3. Here is (part of) my code:
tell application "Adobe Illustrator"
tell newDocument
make new rectangle with properties {bounds:{200.0, 400.0, 300.0, 200.0}}
end tell
end tell
I copied the make new rectangle
part from page 153 of this, from Adobe's website.
But what are the bounds
??? When I run the script, they don't match up with the co-ordinates of the rectangle:
How do I convert from co-ordinates to bounds? My canvas size is 1920
by 1080
.
解决方案
Well, as it says in the reference on p.153, the bounds
are as follows:
- left-most horizontal
- top vertical
- right-most horizontal
- bottom vertical
bound of the rectangle, measured from the bottom left corner (0, 0). The X and Y coordinates you see will be the coordinates of the rectangle's center point. However, the width and height in your screenshot are strange: when running your code (with bounds:{200, 400, 300, 200}
), I obtained a rectangle having its center at X=250, Y=300, and dimensions of W=100, H=200, as expected.