[jawsscripts] Detecting color

  • From: Jitendra <jeet.invincible@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Wed, 02 Sep 2009 16:17:20 +0530

Hello friends, following code should detect the color, and perform 
accordingly, while reading the code, see the comments by me also.

var
int nCurrent,
Int color,
Int Restriction
SpeechOff()
SaveCursor ()
JAWSCursor ()
SaveCursor ()
RouteJAWSToPc()
RightMouseButton ()
Delay (2, true)
if MenusActive ()then
FindString (GetFocus (), "Brows", s_bottom, s_restricted)
Let color = GetColorBackground ()
;the color spoken by JAWS is in quotes in the line below.
If ColorToRGBString (Color) == "001000000" Then
;following Line I am not sure will work or not, since the 0 is for the 
black, and in this color string, the 3rd number from left is 1.
If Color == "0" Then

SpeechOn ()
SayFormattedMessage (OT_Error, "Sorry, you can't brows the file, the 
button is unavailable."
 {Escape}
Return
Else
SpeechOff ()
LeftMouseButton ()
EndIf
Endif
StopSpeech ()
waitForKeysToClear(5)
SpeechOn ()
RestoreCursor ()
RestoreCursor ()
the reason writing this code is to quickly access the feature since this 
app does not have menu ids, I can't send messages of that type.
Thank you, Jitendra.
__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: