Disabling 'Nap mode' via AppleScript - problems

Discussion in 'Mac Basics and Help' started by Will Cheyney, Jan 6, 2006.

  1. macrumors 6502a

    Will Cheyney

    Joined:
    Jul 13, 2005
    Location:
    United Kingdom
    #1
    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:


    Can anyone offer a helping hand?
    Thanks
     
  2. Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    Whakatane, New Zealand
    #2
    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 :(
     
  3. Wes
    macrumors 68020

    Wes

    Joined:
    Jun 22, 2001
    Location:
    London
    #3
    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.
     

Share This Page