使用 applescript 更改屏幕刷新率
Change screen refresh rate with applescript
我目前在办公室使用 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
window 的样子:
找到一个 shell 应用程序来执行此操作,名为 cscreen
注意:我只有在指定分辨率 (-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
我目前在办公室使用 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
window 的样子:
找到一个 shell 应用程序来执行此操作,名为 cscreen
注意:我只有在指定分辨率 (-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