Aggiornamento: questo script aggiornato non lampeggia attraverso lo schermo, quindi viene eseguito nel backgound. La vecchia versione è ancora valida.
tell application "System Events"
tell process "System Preferences"
activate
end tell
tell application "System Preferences"
set current pane to pane "com.apple.preference.energysaver"
end tell
tell process "System Preferences"
click checkbox 1 of window 1
end tell
tell application "System Preferences"
quit
end tell
end tell
Dal 18 ottobre:
-- Allow Script Editor in Accessibility <- Privacy <- Security & Privacy <- System Preferences. For testing, at the very least.
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.energysaver"
end tell
tell application "System Events"
tell process "System Preferences"
tell window 1
click checkbox 1
end tell
end tell
end tell
tell application "System Preferences"
quit
end tell
-- Create an Automator Service with this, so that you can bind the action to a keyboard shortcut.