0

特定のアプリのウィンドウを特定の座標に移動したいと思います。

少し生のスクリプトを作成しましたが、よりエレガントで機能的な方法で作成したいと考えています。タイトルに決定された単語を含むウィンドウのみを移動する必要があります。おそらく、タイトルにその単語を含むウィンドウのリストを作成し、それらを循環してそれらの座標に配置する必要があります。

どうすればそれを達成できますか?

それは私がこれまでに書いたことです:

tell application "System Events"
    tell process "AppIT"
        (*
    {804, 368}
{536, 368}
{268, 368}
{0, 368}
{804, 22}
{536, 22}
{268, 22}
{0, 22}
*)
        set position of window 1 to {0, 22}
        set position of window 2 to {268, 22}
        set position of window 3 to {536, 22}
        set position of window 4 to {804, 22}
        set position of window 5 to {0, 368}
        set position of window 6 to {268, 368}
        set position of window 7 to {536, 368}
        set position of window 8 to {804, 368}

        set position of window 9 to {0, 22}
        set position of window 10 to {268, 22}
        set position of window 11 to {536, 22}
        set position of window 12 to {804, 22}
        set position of window 13 to {0, 368}
        set position of window 14 to {268, 368}
        set position of window 15 to {536, 368}
        set position of window 16 to {804, 368}

        set position of window 17 to {0, 22}
        set position of window 18 to {268, 22}
        set position of window 19 to {536, 22}
        set position of window 20 to {804, 22}
        set position of window 21 to {0, 368}
        set position of window 22 to {268, 368}
        set position of window 23 to {536, 368}
        set position of window 24 to {804, 368}
    end tell
end tell
4

1 に答える 1

1
tell application "System Events"
    tell process "TextEdit"
        set w to windows where title contains "text"
        set position of item 1 of w to {0, 22}
        set position of item 2 of w to {268, 22}
    end tell
end tell
于 2012-12-15T09:16:10.013 に答える