• 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: Dealing with Sliders...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dealing with Sliders...


  • Subject: Re: Dealing with Sliders...
  • From: John Baltutis <email@hidden>
  • Date: Fri, 10 Feb 2006 17:06:35 -0800

On 02/10/06,  email@hidden wrote:
>
> I need to write an Applescript that deals with the Energy Saver Preference
>Pane
> and sets the machine to never sleep and never put the hard disk to sleep.
>
> Here is what I have so far:
>
> tell application "System Preferences"
> 	activate
> 	set current pane to pane "com.apple.preference.energysaver"
> end tell
>
> tell application "System Events"
> 	tell process "System Preferences"
>
> 		set theSlider to slider 1 of tab group 1 of group 1 of window "Energy
>Saver"
> 		set the value of theSlider to "Never"
> 	end tell
> end tell
>
> Here is the error:
> System Events got an error: NSReceiverEvaluationScriptError: 4
>
> It highlights the Slider 1 section of the first set line.
>
> Does anybody have any thoughts on how I can control these sliders?

Take a look at the manpage for pmset. Everthing should be doable there with do
shell script. For an applescript solution, see
<http://www.macosxhints.com/article.php?story=200503020315453> for some hints.

BTW, the Energy Saver prefpane settings are in stored in
/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist and
maybe a do shell script "defaults write
/Library/Preferences/SystemConfiguration/com.apple.PowerManagement" with the
appropriate key and value combination command might be better for what you're
trying to do.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Dealing with Sliders...
      • From: "John C. Welch" <email@hidden>
  • Prev by Date: Re: Another Shell Script question ftp
  • Next by Date: Re: Dealing with Sliders...
  • Previous by thread: Re: Dealing with Sliders...
  • Next by thread: Re: Dealing with Sliders...
  • Index(es):
    • Date
    • Thread