Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Will Cheyney

macrumors 6502a
Original poster
Jul 13, 2005
701
0
United Kingdom
So, I want to disable 'Nap mode' automatically on start up on my G5.
I came across the following AppleScript code but can't get it to work!

Code:
do shell script "hwprefs cpu_nap=1"

I have also tried the variation of that:
Code:
do shell script "hwprefs cpu_nap=false"

I compiled them and saved as an application, but get this error message whenever they are set to run:

hwprefs: PERMISSION DENIED: effective user id MUST be root user to run


Can anyone offer a helping hand?
Thanks
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,595
3,934
New Zealand
I'm pretty sure you need root privileges, which means typing your password. This would be a nightmare if the script is running on boot, so I can't offer any suggestions :(
 

4409723

Suspended
Jun 22, 2001
2,221
0
Yeah you need to be root user so:

do shell script "sudo hwprefs cpu_nap=false"

But then as Nermal says you are going to need to enter your password... I'm sure there is a way to build it into the script though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.