【问题标题】:Applescript Ventura Toggle Accessibility Grayscale On/OffApplescript Ventura 切换辅助功能灰度开/关
【发布时间】:2023-02-12 05:36:21
【问题描述】:

在 AppleScript 中打开/关闭灰度效果非常好(参见https://stackoverflow.com/a/58469753/2950707)。

但是,此脚本在 Ventura 中中断。

我怎样才能修改脚本来完成同样的事情?

【问题讨论】:

    标签: applescript macos-ventura


    【解决方案1】:

    像这样,显然

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-23
      • 2016-06-03
      • 1970-01-01
      • 1970-01-01
      • 2022-11-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多