Quiero poder imprimir si True Tone está activado o desactivado en un script. ¿Hay un comando para determinar esto?
Respuesta
¿Demasiados anuncios?Puedes probar esto, Fuente completamente referenciada desde Reddit
tell application "System Preferences"
if it is running then
quit
end if
end tell
delay 0.2
activate application "System Preferences"
tell application "System Events"
tell process "System Preferences"
click button "Displays" of scroll area 1 of window "System Preferences"
delay 0.8
click radio button "Display" of tab group 1 of window "Built-in Retina Display"
click checkbox "True Tone" of tab group 1 of window "Built-in Retina Display"
end tell
quit application "System Preferences"
end tell
La otra solución es:
use sys : application "System Events"
use prefs : application "System Preferences"
property prefsUI : a reference to process "System Preferences"
property _W : a reference to windows of prefsUI
property _TT : a reference to checkbox "True Tone" of tab group 1 of _W
property pane : "com.apple.preference.displays"
property anchor : "displaysDisplayTab"
property tab : anchor (my anchor) of pane id (my pane)
set TrueTone to null
if tab ≠ (reveal tab) then return null
tell _TT to if exists then set TrueTone to its value as boolean
quit prefs
TrueTone