0

Toggling grayscale on/off worked fantastically with AppleScript (see https://stackoverflow.com/a/58469753/2950707 ).

However, this script breaks in Ventura.

How could I modify the script to accomplish the same?

ppt
  • 946
  • 8
  • 18

1 Answers1

1

Like this, apparently

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
ppt
  • 946
  • 8
  • 18