我想使用Applescript将Mac屏幕分辨率设置为“缩放”,“大文本”。
我发现下面的stackoverflow脚本非常适合选择第二个缩放分辨率按钮。但是,我要选择第一个“大文本”。要解决该问题,需要单击“确定”按钮,但我不知道该怎么做。
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane
"com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
click radio button "Scaled" of radio group 1 of tab group 1
click radio button 2 of radio group 1 of group 1 of tab group 1
end tell
quit application "System Preferences"
我将按钮2更改为按钮1,但分辨率没有变化。
感谢您的帮助。
答案 0 :(得分:0)
此AppleScript代码适用于使用最新版本的macOS Mojave的我。
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
click radio button "Scaled" of radio group 1 of tab group 1
click radio button 1 of radio group 1 of group 2 of tab group 1
delay 0.1 -- May Need To Adjust
try
click button "OK" of sheet 1
end try
end tell
quit application "System Preferences"
答案 1 :(得分:0)
我编写了一个名为displayplacer的命令行实用程序,它使超级超级简单-特别是对于多显示器设置。例如,我可以通过执行displayplacer "id:F466F621-B5FA-04A0-0800-CFA6C258DECD res:1024x640 scaling:on origin:(-1024,1060) degree:0"
也可以通过自制软件访问:brew tap jakehilborn/jakehilborn && brew install displayplacer