• 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: kai <email@hidden>
  • Date: Fri, 10 Feb 2006 21:36:44 +0000


On 10 Feb 2006, at 20:38, 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?

Try something like this, Jason:

----------------

tell application "System Preferences" to reveal (first anchor of pane ¬
"com.apple.preference.energysaver" whose name is "Sleep")
tell application "System Events" to set value of slider 1 of tab group 1 ¬
of window "Energy Saver" of process "System Preferences" to 901


----------------

---
kai


_______________________________________________ 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: kai <email@hidden>
References: 
 >Dealing with Sliders... (From: email@hidden)

  • Prev by Date: RE: Another Shell Script question ftp
  • Next by Date: Re: File exists on a posix path
  • Previous by thread: Dealing with Sliders...
  • Next by thread: Re: Dealing with Sliders...
  • Index(es):
    • Date
    • Thread