【问题标题】:Change screen refresh rate with applescript使用 applescript 更改屏幕刷新率
【发布时间】:2019-02-19 22:16:06
【问题描述】:

我目前在我的办公室使用 2 个屏幕和我的 macbook。每天几次,其中一种屏幕颜色非常接近红色光谱。我可以通过将刷新率更改为 50 再回到 60 来让屏幕恢复正常颜色。

我想编写脚本,每次登录时都会自动发生这种情况。我想用applescript和automator来实现这一点。

到目前为止我在网上找到的:

tell application "System Preferences"
 activate
 set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
 tell process "System Preferences"
 click radio button "Display" of tab group 1 of window "BenQ GL2450H (2)"
 delay 1
 ******************************************
 Change refresh rate back and forward, how?
 ******************************************
 end tell
end tell
delay 1
tell application "System Preferences"
 quit
end tell

窗口的外观:

【问题讨论】:

    标签: macos applescript automator


    【解决方案1】:

    找到了一个名为cscreen的shell应用程序

    注意:我只有在指定分辨率(-x,-y)时才让选项 -r 起作用

    ChangeScreenRefreshRate.sh:

    cscreen -s 2 -x 1920 -y 1080 -r 50
    sleep 5
    cscreen -s 2 -x 1920 -y 1080 -r 60
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-15
      相关资源
      最近更新 更多