How can I move/resize windows programmatically from another application?

前端 未结 3 1777
滥情空心
滥情空心 2020-12-19 15:15

I know, that I can use Apple Event Object Model for moving and resizing windows of Cocoa applications. But what can I use for Carbon applications?

3条回答
  •  不知归路
    2020-12-19 15:52

    Peter was right, you can access to bounds of any window using the following AppleScript:

    tell application "System Events"
        set allProcesses to application processes
        repeat with i from 1 to count allProcesses
            tell process i
                repeat with x from 1 to (count windows)
                    position of window x
                    size of window x
                end repeat
            end tell
        end repeat
    end tell
    

提交回复
热议问题