سؤال

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:

rectangle co-ordinated

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:

  1. left-most horizontal
  2. top vertical
  3. right-most horizontal
  4. 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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top