Tal vez este código applescript ayude un poco
tell application "System Preferences"
reveal anchor "Main" of pane id "com.apple.preference.general"
end tell
tell application "System Events"
repeat until exists of checkbox "Dark" of window "General" of application process "System Preferences"
delay 0.1
end repeat
-- Appearance
click checkbox "Dark" of window "General" of application process "System Preferences"
-- Accent Color
click checkbox "Red" of window "General" of application process "System Preferences"
-- Dropdown Menu For Highlight Color
click pop up button 1 of window "General" of application process "System Preferences"
-- Highlight Color
click menu item "Red" of menu 1 of pop up button 1 of window "General" of application process "System Preferences"
end tell
tell application "System Preferences" to quit
ACTUALIZACIÓN:
Dando un paso más, guarde el siguiente código AppleScript como una aplicación. Cuando se lanza esta nueva aplicación, permite elegir sus diferentes modos de color.
property appearanceMode : {"Light", "Dark"}
property accentColors : {"Blue", "Purple", "Pink", "Red", "Orange", "Yellow", "Green", "Graphite"}
property highlightColors : {"Blue", "Purple", "Pink", "Red", "Orange", "Yellow", "Green", "Graphite", "Other"}
activate
set chosenAppearanceMode to (choose from list appearanceMode ¬
with title "Please Choose Your Appearance Mode" with prompt ¬
"Please Choose Your Appearance Mode" OK button name ¬
"OK" cancel button name "CANCEL") as string
if chosenAppearanceMode is "false" then return
activate
set chosenAccentColor to (choose from list accentColors ¬
with title "Please Choose Your Accent Color" with prompt ¬
"Please Choose Your Accent Color" OK button name ¬
"OK" cancel button name "CANCEL") as string
if chosenAccentColor is "false" then return
activate
set chosenHighlightColor to (choose from list highlightColors ¬
with title "Please Choose Your Highlight Color" with prompt ¬
"Please Choose Your Highlight Color" OK button name ¬
"OK" cancel button name "CANCEL") as string
if chosenHighlightColor is "false" then return
try
if application "System Preferences" is running then do shell script "killall 'System Preferences'"
end try
repeat until application "System Preferences" is not running
delay 0.1
end repeat
tell application "System Preferences" to reveal anchor "Main" of pane id "com.apple.preference.general"
tell application "System Events"
repeat until exists of checkbox chosenAppearanceMode of window "General" of application process "System Preferences"
delay 0.1
end repeat
-- Appearance
click checkbox chosenAppearanceMode of window "General" of application process "System Preferences"
-- Accent Color
click checkbox chosenAccentColor of window "General" of application process "System Preferences"
-- Dropdown Menu For Highlight Color
click pop up button 1 of window "General" of application process "System Preferences"
-- Highlight Color
click menu item chosenHighlightColor of menu 1 of pop up button 1 of window "General" of application process "System Preferences"
end tell
try
if application "System Preferences" is running then do shell script "killall 'System Preferences'"
end try
NOTA AL MARGEN: Mi razón para usar el do shell script "killall 'System Preferences'"
en lugar de tell application "System Preferences" to quit
es... Digamos que, por la razón que sea, System Preferences.app ya está activada (con, por ejemplo, la ventana Compartir/Gestión remota/Configuración del equipo abierta) pero no está visible o no está al frente de la mayoría o lo que sea. En el Editor de script, intentas ejecutar tell application "System Preferences" to reveal anchor "SpeakableItems" of pane id "com.apple.preference.universalaccess"
Ese comando se completa sin errores obvios, pero cuando cambia a Preferencias del Sistema, su "ancla revelada" no se revela. Ok, no es gran cosa, es fácil de arreglar. Simplemente insertaré un tell application "System Preferences" to quit
antes del comando reveal anchor
de mando. Al ejecutar el código actualizado esta vez, se obtiene un error (userCanceledErr:-128). Todo este jaleo se debe a que esa ventana desplegable secundaria de Preferencias del Sistema está abierta. En mi opinión, el do shell script "killall 'System Preferences'"
parece ser la mejor solución.