VoiceOver and the mouse cursor - slight bug and workaround
VoiceOver and the mouse cursor - slight bug and workaround
- Subject: VoiceOver and the mouse cursor - slight bug and workaround
- From: Axel Luttgens <email@hidden>
- Date: Tue, 15 Jun 2010 15:56:24 +0200
I thought this could be a modest yet possibly useful information for those trying to script VoiceOver. So, here it is.
Trying something like this:
tell application "VoiceOver" to get position of mouse cursor
tends to be very frustrating as of Mac OS X 10.6.3... ;-)
In fact, it seems that there's a name conflict, and that VoiceOver tends to always access the property related to the caption panel or the braille panel. I don't know why a separate class for the mouse cursor's position property has been defined, nor whether this should be considered as a bug; the fact is that a workaround is currently needed, for example:
on VO_MouseCursorGet()
tell application "VoiceOver" to get mouse cursor
return «class posi» of result
end VO_MouseCursorGet
on VO_MouseCursorSet(X, Y)
tell application "VoiceOver" to get mouse cursor
set «class posi» of result to {X, Y}
end VO_MouseCursorSet
That way, it appears that interesting things should eventually be feasible, such as:
on VO_MouseCursorDragTo(X, Y)
tell application "VoiceOver" to press mouse cursor
VO_MouseCursorSet(X, Y)
tell application "VoiceOver" to release mouse cursor
end VO_MouseCursorDragTo
As a quick example, one may run this one in AppleScript Editor by leaving the mouse pointer above some window's title bar and pressing Cmd+R:
set {dstX, dstY} to VO_MouseCursorGet()
VO_MouseCursorDragTo(dstX + 30, dstY + 30)
As a side note, it seems that a press/release sequence is equivalent to pressing twice the VO+Cmd+Shift+Space key combo.
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:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden