macos - 如何从另一个应用程序以编程方式移动/调整窗口大小?

标签 macos macos-carbon

我知道,我可以使用 Apple 事件对象模型来移动和调整 Cocoa 应用程序的窗口大小。但是我可以将什么用于 Carbon 应用程序?

最佳答案

彼得是对的,您可以使用以下 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

关于macos - 如何从另一个应用程序以编程方式移动/调整窗口大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4231110/

相关文章:

macos - 在 OS X 上为 LLVM 设置环境变量

cocoa - 来自 AXUIElement 的 CGWindowID

c++ - QT + winId() - 确定句柄类型

cocoa - 从 MAC OS X 应用程序中提取信息

objective-c - 在 Cocoa 中查找处理器类型是 PPC 还是 Intel 的最佳方法是什么? (我必须使用碳吗?)

c++ - 打开 url mac osx c++

macos - mac os X 上的 svn,SSL 错误 : point is not on curve

macos - 条件绑定(bind)中的电子邮件验证绑定(bind)值必须是可选类型

python - 使用 matplotlib 'format "rgba 的动画“不支持”

ruby-on-rails - 终端卡在安装ri文档的 rails 上