Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to set CPU processing speed' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to set CPU processing speed
Authored by: Anonymous on Mar 03, '05 03:16:16PM
I added some code to this applescript to give you a choice of "Highest" or "Reduced" in a dialog box. Which ever one you choose the applescript sets your CPU to the desired result.

global myCPU
set myCPU to ""
display dialog "What would you like?" buttons {"Highest","Reduced"}

copy the result as list to {button_pressed}
if button_pressed is "Highest" then
   set myCPU to "Highest"
else if button_pressed is "Reduced" then
   set myCPU to "Reduced"
end if

tell app "System Preferences"
activate
  set current pane to pane "com.apple.preference.energysaver"
  tell app "System Events"
        get properties
        tell process "System Preferences"
          tell window "Energy Saver"
            tell group 1
             tell tab group 1
               click radio button "Options"
               click pop up button 1
             click menu item myCPU of menu "OtherViews" of pop up button 1
               try
                  click button "Click the lock to make changes" of window 
                   "Network" of process "System Preferences" of 
                      application "System Events"
               end try
              end tell
             end tell
            end tell
           end tell
          end tell
end tell

ignoring application responses
      tell app "System Preferences" to quit
display dialog "CPU Speed set to " & myCPU giving up after 2
end ignoring
I also did something just like this to set my sound to the left, right, or center.

[ Reply to This | # ]
A script to set CPU processing speed
Authored by: gapns on Mar 05, '05 09:06:01AM
When I tried to use this script on my iMac G5, I had to change the tab group from 1 back to 0

				tell group 0
					tell tab group 0

otherwise it works well.
Thanks

[ Reply to This | # ]
A script to set CPU processing speed
Authored by: GlowingApple on Mar 07, '05 01:42:17PM

When I try to run this script I get an error on the line "ignoring application responses". The error is "Expected end of line, etc. but found end of script." If I comment the line out it compiles. Then when I run it again I get an error on the line "click menu item myCPU of menu "OtherViews" of pop up button 1" The error here is "System Events got an error: NSReceiverEvaluationScriptError: 4" I have a feeling this has something to do with the fact that my panels are all locked. I see the try statement to try to unlock them, but it seems it does not work. I don't know too much about GUI scripting, so I'm not sure what I'd need to change. Any ideas?

Thanks!

---
Jayson

When Microsoft asks you, "Where do you want to go today?" tell them "Apple."



[ Reply to This | # ]