Je veux pouvoir imprimer si le True Tone est activé ou désactivé dans un script. Existe-t-il une commande permettant de le déterminer ?
Réponse
Trop de publicités?Vous pouvez essayer ceci, Source complètement référencée de 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
L'autre solution est :
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