Automatic graphic switch via Apple Script
hi community,
I would like to change the "Automatic graphics switching" (tick on / tick off) via an Apple Script. I made the following script and it works, except with line "click chckbox 2". Here it ticks the box "Show battery status in menu bar". With "click checkbox 1" it takes the "Lock-Button".
I would be glad if anybode could tell me the right code for ticking the checkbox "automatic graphics switching" via Apple Script.
Thanks a lot
PS: Yes I know that tool gfx Status, but I wanna do this via Apple Script.
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.energysaver"
delay 0.5
tell application "System Events"
tell process "Systemeinstellungen"
tell window "Energie sparen"
clickcheckbox 2
delay 0.5
end tell
end tell
end tell
quit
end tell
quit
MacBook Pro (17-inch Early 2011), OS X Mountain Lion (10.8.2)