要使用AppleScript获取当前的显示分辨率,您可以运行以下脚本:
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中。最后,一个对话框将显示当前的分辨率。
领取专属 10元无门槛券
手把手带您无忧上云