Re: Pref. pane (need more help)
Re: Pref. pane (need more help)
- Subject: Re: Pref. pane (need more help)
- From: Axel Luttgens <email@hidden>
- Date: Thu, 24 Mar 2005 14:04:34 +0100
Bernard Azancot wrote:
Someone here sent me the following code.
I need to set the screen brightness from the minimum to the maximum
(slider pushed from the left to the right).
The script opens the screen pref. pane and stops.
Any suggestion, would be appreciated.
Thanks in advance.
Bernard
-- Script --
set bValue to 0.8
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences"
tell radio button "Display" of tab group 1 of window 1 to if value
is 0 then
repeat until value is 1
click
end repeat
end if
tell slider 1 of group 2 of tab group 1 of window 1 to set value to
bValue
end tell
tell application "System Preferences" to quit
-- End of script --
Which radio button are you targeting in the above?
On my computer, your script chokes on trying to get its value.
If you are trying to achieve some visual effect, perhaps could you
consider some variation around the following one:
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
tell process "System Preferences"
tell slider 1 of group 2 of tab group 1 of window 1
repeat with currV from 0 to 10 by
set value to currV / 10
end repeat
set value to 0.5
end tell
end tell
end tell
tell application "System Preferences" to quit
HTH,
Axel
|
_______________________________________________
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