首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

AppleScript如何获得当前的显示分辨率?

要使用AppleScript获取当前的显示分辨率,您可以运行以下脚本:

代码语言:javascript
复制
tell application "System Events"
    set screenWidth to current screen's bounds width
    set screenHeight to current screen's bounds height
end tell

display dialog "屏幕分辨率为:" message screenWidth & " x " & screenHeight

这个脚本首先告诉System Events应用程序来获取当前屏幕的宽度和高度,然后将这些值存储在变量screenWidth和screenHeight中。最后,一个对话框将显示当前的分辨率。

页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

领券