I have been trying to create an applescript to automate the switching enery prefernces in jaguar. I used UI Browser to find out I need this…
pick menu item “Highest Performance” of menu “OtherViews” of pop up button 1 of window “Energy Saver”
code, to change the energy setting in the window…but every time I try to compile the code it says to me Syntax Error “Expected end of line, etc. but found class name.” at the menu item of the pick command. any suggestions… here is the entire code so far
display dialog “Which Energy Setting would you like?” buttons {“Cancel”, “High Performance”, “Long Lasting Battery”} default button 3
if the button returned of the result is “High Performance” then
tell application “System Events”
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.energysaver”
pick menu item “Highest Performance” of menu “OtherViews” of pop up button 1 of window “Energy Saver”
end tell
end tell
else --2nd button’s function
tell application “System Events”
tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.energysaver”
pick menu item “Long Lasting Battery” of menu “OtherViews” of pop up button 1 of window “Energy Saver”
end tell
end tell
end if