Reduce Transparency


Keyboard Maestro 10.2 on macOS 12.6


Hi Everyone,

I know this topic been discussed before, unfortunately none of that worked for me so far.
What's the best way to activate Reduce transparency on macOS.

So far I tried ...

Shell script

defaults write com.Apple.universalaccess reduceTransparency -bool TRUE

AppleScript (This Script does work if the System Preferences window is opened in the Accessibility -> Display Menu. But not from inside KM.)

tell application "System Preferences" to activate
tell application "System Events"
	tell it's application process "System Preferences"
		tell it's window "Accessibility"
			tell it's tab group 1 of group 1
				click checkbox "Reduce transparency"
			end tell
		end tell
	end tell
end tell

If anyone has a solution, I love to try it.
Thanks

Hey Jack,

That script is essentially useless...

This has been done, but I have't seen an update for later versions of macOS.

AppleScript/KM Solution to Toggle the System Preferences “Reduce Transparency” On/OFF Checkbox

Getting it to work in pretty bombproof fashion isn't easy.

I've got this working on macOS 10.14.6 Mojave, but I'm sure it will require adjustments to work on macOS Monterey.

tell application "System Preferences"
   if not running then
      run
   end if
   activate
   if name of its front window is not "Accessibility" then
      reveal pane id "com.apple.preference.universalaccess"
      tell pane id "com.apple.preference.universalaccess"
         reveal anchor "Seeing_Display"
      end tell
   end if
end tell

tell application "System Events"
   tell application process "System Preferences"
      repeat while (get name of window 1) ≠ "Accessibility"
         delay 0.1
      end repeat
      tell window "Accessibility"
         tell scroll area 1
            tell table 1
               set displayPrefs to UI element 1 of rows where its name is "Display"
               repeat with i in displayPrefs
                  if contents of i ≠ missing value then
                     set displayPrefs to contents of i
                  end if
               end repeat
               try
                  displayPrefs / 0
               on error displayPrefRowNum
                  set AppleScript's text item delimiters to {"«class crow» ", " of «class tabB»"}
                  set displayPrefRowNum to (text item 2 of displayPrefRowNum) as integer
               end try
               set displayPrefRow to row displayPrefRowNum
               select displayPrefRow
            end tell
         end tell
         tell group 1
            tell checkbox "Reduce transparency"
               perform action "AXPress"
            end tell
         end tell
      end tell
   end tell
end tell

-Chris

Hey Chris,

Thanks for the AppleScript.

I made a small change to make it work, is it possible to run this with out bringing the preference window to the front every time.

tell application "System Preferences"
   if not running then
      run
   end if
   activate
   if name of it's front window is not "Accessibility" then
      reveal pane id "com.Apple.preference.universalaccess"
      tell pane id "com.Apple.preference.universalaccess"
         reveal anchor "Seeing_Display"
      end tell
   end if
end tell

tell application "System Events"
   tell application process "System Preferences"
      repeat while (get name of window 1) ≠ "Accessibility"
         delay 0.1
      end repeat
      tell window "Accessibility"
         tell scroll area 1
            tell table 1
               set displayPrefs to UI element 1 of rows where it's name is "Display"
               repeat with I in displayPrefs
                  if contents of I ≠ missing value then
                     set displayPrefs to contents of I
                  end if
               end repeat
               try
                  displayPrefs / 0
               on error displayPrefRowNum
                  set AppleScript's text item delimiters to {"«class crow» ", " of «class tabB»"}
                  set displayPrefRowNum to (text item 2 of displayPrefRowNum) as integer
               end try
               set displayPrefRow to row displayPrefRowNum
               select displayPrefRow
            end tell
         end tell
         tell it's tab group 1 of group 1
            tell checkbox "Reduce transparency"
               perform action "AXPress"
            end tell
         end tell
      end tell
   end tell
end tell

-Jack

Great, I'm glad you got it working.

To stop the settings from being activated delete or comment-out the “activate” line near the top.