I would like to chage a System Preferences setting, for example disabling the battery status icon.
I’m able to do that, but I would like to know if it’s possible to do it in an invisible way, so no System Preferences window appear in all the process.
Is that possible?
My applescript looks like this:
tell application id “com.apple.systempreferences”
set current pane to pane id “com.apple.preference.energysaver”
tell application “System Events”
tell process “System Preferences”
if (value of checkbox “Show battery status in the menu bar” of window 1 is 1) is true then
if (exists checkbox “Click the lock to make changes.” of window 1) is true then
click checkbox “Click the lock to make changes.” of window 1
–WAIT UNTIL USER & PASSWORD HAS BEEN ENTERED
repeat until (count of every window) is not 0
click checkbox “Show battery status in the menu bar” of window 1
Thnaks in advance!