【问题标题】:Python: how to get window size and location in mac [closed]Python:如何在mac中获取窗口大小和位置[关闭]
【发布时间】:2022-01-11 10:43:52
【问题描述】:

如何使用python获取mac中活动窗口的大小和位置?

【问题讨论】:

标签: python macos


【解决方案1】:

免责声明:我没有可以测试的 mac。

看来你可以用 applescript 做到这一点:

tell application "Finder" to get position of front window

设置:

tell application "Finder" to set {x, y} to position of front window

请参阅command reference 了解更多信息。

还有图书馆,例如https://github.com/rdhyee/py-applescript

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-19
    • 2011-06-13
    相关资源
    最近更新 更多