I’m trying to get UI Scripting to select a menu item in a pop up button in Expose…
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Exposé" of menu "View" of menu bar 1
delay 0.8
click pop up button 1 of group 1 of window "Exposé"
(*if the name of every menu item of pop up button 1 of group 1 of window "Exposé" contains "Desktop" then
click menu item "Desktop"
end if *)
end tell
end tell
The script clicks the proper button but I can’t get it to select any of the 6 different menu items. Any help is appreciated. tia
I think I got it…
click menu item "Desktop" of menu of pop up button 1 of group 1 of window "Exposé"
Here’s the script that I’m using to turn off Expose…
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Exposé" of menu "View" of menu bar 1
delay 1.25
click pop up button 1 of group 1 of window "Exposé"
delay 1
click last menu item of menu of pop up button 1 of group 1 of window "Exposé"
delay 0.25
click pop up button 2 of group 1 of window "Exposé"
delay 0.25
click last menu item of menu of pop up button 2 of group 1 of window "Exposé"
delay 0.25
click pop up button 3 of group 1 of window "Exposé"
click last menu item of menu of pop up button 3 of group 1 of window "Exposé"
delay 0.25
click pop up button 4 of group 1 of window "Exposé"
click last menu item of menu of pop up button 4 of group 1 of window "Exposé"
end tell
end tell
It could be cleaned up a bit, but it works ;¬)
Just found a faster way over at: http://bbs.applescript.net/viewtopic.php?pid=76429#p76429
In case the link should break…
property theExposeDefinition : {topLeftCorner:"wvous-tl-corner", topRightCorner:"wvous-tr-corner", bottomLeftCorner:"wvous-bl-corner", bottomRightCorner:"wvous-br-corner", doNothing:1, allWindows:2, appWindows:3, showDesktop:4, startScreenSaver:5, disableScreenSaver:6}
set theCorner to theExposeDefinition's bottomLeftCorner
set theAction to theExposeDefinition's showDesktop
set theScript to "defaults write com.apple.dock " & theCorner & " -int " & theAction & " ; killall Dock"
do shell script theScript