• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get value of PowerManagement Plist key? / Keychain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get value of PowerManagement Plist key? / Keychain


  • Subject: Re: Get value of PowerManagement Plist key? / Keychain
  • From: Neil Lee <email@hidden>
  • Date: Tue, 14 Jun 2005 13:34:49 -0400

Le 05-06-14 à 12:49, Martin Orpen a écrit :

If you are already using pmset, you could grab the value using awk:

do shell script "pmset -g | awk '/dps/ { print $NF }'"

Awesome! That did the trick.

For anyone who's curious, here's the script that toggles between the Automatic and Maximum processor speed.

I'm still figuring out Applescript so I'm sure this isn't the most efficient way to do this - if anyone has any suggestions for improvement, I'm all ears.

on run
set cpuStatus to do shell script "pmset -g | awk '/dps/ { print $NF }'"
if cpuStatus is "1" then
set cpuCommand to "pmset -a dps 0"
do shell script cpuCommand with administrator privileges
beep
display dialog "Processor speed now Maximum"
return
end if
set cpuCommand to "pmset -a dps 1"
do shell script cpuCommand with administrator privileges
beep
display dialog "Processor speed now Automatic"
end run


Neil


-- Slumming at the beatnikPad : http://www.beatnikpad.com/ The person you love is 72.8% water.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Get value of PowerManagement Plist key? / Keychain (From: Martin Orpen <email@hidden>)

  • Prev by Date: Re: My mail script problem
  • Next by Date: create a DVD with applescript/automator
  • Previous by thread: Re: Get value of PowerManagement Plist key? / Keychain
  • Next by thread: My mail script problem
  • Index(es):
    • Date
    • Thread