Re: Dealing with Sliders...
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