2

我正在尝试将一个窗口移动到屏幕的左上角。

这是我写的:

tell application "System Events"
    tell application process "appIT"
        tell window 1
            --Move lobby to left corner
            set s to size
            activate
            set the bounds to {40, 40, item 1 of s, item 2 of s}
        end tell
    end tell
end tell

但是当我运行脚本时,我收到了这个错误:

系统事件发现错误:我无法将应用程序进程“appIT”的窗口 1 的边界设置为 {40、40、1037、696}

我究竟做错了什么?

4

2 回答 2

2

我让它工作:

tell window 1
    activate
    set position to {0, 20}
end tell
于 2012-10-19T07:09:18.783 回答
1

我能够用这样的东西让它工作:

tell application "appIT"
    tell window 1
        --Move lobby to left corner
        set s to bounds
        activate
        set the bounds to {40, 40, (item 3 of s) - (item 1 of s), (item 4 of s) - (item 2 of s)}
    end tell
end tell
于 2012-10-18T08:25:33.477 回答