【发布时间】:2023-02-12 05:36:21
【问题描述】:
在 AppleScript 中打开/关闭灰度效果非常好(参见https://stackoverflow.com/a/58469753/2950707)。
但是,此脚本在 Ventura 中中断。
我怎样才能修改脚本来完成同样的事情?
【问题讨论】:
在 AppleScript 中打开/关闭灰度效果非常好(参见https://stackoverflow.com/a/58469753/2950707)。
但是,此脚本在 Ventura 中中断。
我怎样才能修改脚本来完成同样的事情?
【问题讨论】:
像这样,显然
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions
current application's NSWorkspace's sharedWorkspace()'s openURL:(current application's NSURL's URLWithString:"x-apple.systempreferences:com.apple.preference.universalaccess?Seeing_Display")
tell application "System Events" to tell application process "System Settings"
repeat until exists window "Display"
end repeat
click checkbox 1 of group 4 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Display"
end tell
if application "System Settings" is running then
tell application "System Settings" to quit
end if
【讨论】: