Reputation: 2088
I'm trying to set checkbox in Mission Control pane in System Preferences. So far I'm able to open MC but I have no idea how to click on checkbox. I tried everything I found on Internet but with no luck... How can I do it?
tell application "System Preferences" activate set current pane to pane "com.apple.preference.expose" end tell
Upvotes: 1
Views: 239
Reputation: 1892
This will click the first checkbox of the pane only if it is currently not checked:
tell application "System Preferences"
set current pane to pane "com.apple.preference.expose"
activate
end tell
tell application "System Events"
tell process "System Preferences"
set firstCheckbox to checkbox 1 of group 2 of window 1
set checked to value of firstCheckbox as boolean
if (not checked) then
click firstCheckbox
end if
end tell
end tell
Upvotes: 1