Re: Get value of PowerManagement Plist key? / Keychain
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