On 2006-10-05, at 15:34:42, kai wrote:
In case anyone doubts that the help property/attribute of a slider normally changes simultaneously to reflect its value, the following routine should help to demonstrate how a similarly constructed (but better configured) slider behaves. (The final setting is intended to restore the original value.)
[..]
As if to prove the point, GUI scripted changes to this slider *do* stick. So what we have here is clearly not a general System Events/System Preferences bug; it's specific to anchor "ScreenSaverPref"'s slider.
But, as shown previously, they do not stick to the Dock's slider. I suspect that it's because Audio software uses a lot of sliders and those folks will have developed methods to handle the situation. But that doesn't mean that it's not a bug. What it means to me is that there is no default behavior that a developer could over-ride if required. Otherwise setting the slider's value would stick.
Back to the quest at hand though. The problem as I see it now is that when manually altering the value of the slider there are only two possible actions:
1. Drag the indicator. 2. Click at a point on the slider exclusive to the rectangle of the indicator.
IOW, all of the previous attempts at a solution, except for the dss method have been targeting the wrong area.
Of the two actions, System Events currently can't handle a drag but it's supposed to be able to handle a mouse click at an arbitrary location. I can for instance click a window's close button like so:
tell application "System Events" to tell application process "Finder" set wpos to position of window 1 set x to (item 1 of wpos) + 12 set y to (item 2 of wpos) + 12 click at {x, y} end tell
Therefore, we should be able to click at a location within the slider's bounds and have the indictor jump to that and have the value stick. However, I'm having a problem getting the slider to recognize the click at what I think is a valid point…
Aarrrggghhhh!
|