【问题标题】:AppleScript - what are bounds?AppleScript - 什么是界限?
【发布时间】:2014-01-29 02:49:59
【问题描述】:

我是 AppleScripting Adob​​e Illustrator CS3。这是(部分)我的代码:

tell application "Adobe Illustrator"
    tell newDocument
        make new rectangle with properties {bounds:{200.0, 400.0, 300.0, 200.0}}
    end tell
end tell

我从 Adob​​e 的网站上复制了 this 第 153 页上的 make new rectangle 部分。

但是bounds 是什么???当我运行脚本时,它们与矩形的坐标不匹配:

如何将坐标转换为边界?我的画布大小是1920 1080

【问题讨论】:

    标签: macos applescript coordinates adobe-illustrator bounds


    【解决方案1】:

    嗯,正如第 153 页的 reference 中所说,bounds 如下:

    1. 最左侧水平
    2. 顶部垂直
    3. 最右侧水平
    4. 底部垂直

    矩形的边界,从左下角 (0, 0) 开始测量。您看到的 X 和 Y 坐标将是矩形中心点的坐标。但是,屏幕截图中的宽度和高度很奇怪:运行代码时(使用bounds:{200, 400, 300, 200}),我得到了一个矩形,其中心位于 X=250,Y=300,尺寸为 W=100,H=200,正如预期的那样。

    【讨论】:

      猜你喜欢
      • 2010-11-21
      • 2012-10-19
      • 1970-01-01
      • 2017-10-20
      • 1970-01-01
      • 2016-01-13
      • 1970-01-01
      • 1970-01-01
      • 2019-11-21
      相关资源
      最近更新 更多