[jawsscripts] Re: JAWS FindColors Function in IE 10

  • From: "Paul Magill" <magills@xxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sat, 18 May 2013 20:54:16 +1000

Hi John and all,

The below script, FindAndReadColoredText,  successfully finds colored text 
using Jaws 13, under Windows XP with I E 8.

** Note 1, it only works when using the Jaws cursor, and when the target 
text is visually on the screen.
Note 2, It failed when the last parameter of FindColors was set to 1, as in 
your first find example.  I dont know why that should be, as the last 
parameter only specifies the extent of the window to search, & as far as I 
know, the I E window is all one window.

The first script, is used to set the global to the text color to find.

I hope this is of some help.

Regards,
Paul from Australia.


Script SetColorToFind ()
; obtains the color to find

VAR

INT Dummy,

STRING ApproxColorName



LET G_TextColor = GetColorText () ; gets the color of the forground text at 
the location of the active cursor

LET ApproxColorName = GetColorName (GetColorApproximation (G_TextColor, 
Dummy))



SayUsingVoice (VCTX_Message, ApproxColorName + ", saved as search color", 
OT_No_Disable)

; SayInteger (G_TextColor)

EndScript

 

 

Script FindAndReadColoredText ()

VAR

INT Dummy,

STRING ApproxColorName



LET ApproxColorName = GetColorName (GetColorApproximation (G_TextColor, 
Dummy))

JAWSCursor ()

IF FindColors (G_TextColor, IgnoreColor , S_Top, 0) THEN

Say (GetColorField (), OT_No_Disable) ; says the colored text

ELSE ; no text of that color found

SayUsingVoice (VCTX_Message, ApproxColorName + " text not found", 
OT_No_Disable)

ENDIF ; search for color successful or not

EndScript

 

----- Original Message ----- 
From: "John P. Thomas" <johnt@xxxxxxxxxxxx>

> Hi scripters,
>
> I tried to get the FindColors function to work in an Internet Explorer
> window about 5 years ago, and gave up, because I couldn't get it to work
> for me. I found some other solutions to my scripting tasks and just
> assumed the function was broken. So here I am again looking at the same
> function once again, because my employer is about to release a new
> internet based administration website for customer service staff. At the
> moment, it looks like the  GetColors function would be the easiest method
> for gaining access, but well I still can't get it to work for me. Here is
> my code. Any suggestions? I am using JAWS 13, with Windows 7, and IE10.
>
>
> ;This first test works properly. It verified that the background color is
> white.
> If GetColorBackground () == RGBStringToColor ("255255255") Then
> SayString ("white back ground")
> Else
> SayString ("not white")
> EndIf
>
> ;This second test works properly. it verified the color of the text at the
> cursor to be red.
> If GetColorText () == RGBStringToColor ("255000000") Then
> SayString ("red text")
> Else
> SayString ("not red")
> EndIf
>
> ; This next function does not work.  It should find red text on a white
> background and then place the JAWS cursor at the location of the desired
> color.
> FindColors (RGBStringToColor ("255000000"), RGBStringToColor
> ("255255255"), s_top,1)
>
> ;This final test searches for the combination of red on white with a test
> to verify if it was found. It always fails even if the cursor is on the
> desired color.
> ; I eliminated the background color from the search to simplify it.
> if FindColors (RGBStringToColor ("255000000"), IgnoreColor, s_next, 0) ==
> true Then
> SayString ("found the color")
> Else
> SayString ("color not found")
> JAWSCursor ()
> SayLine () ;reads the line where the JAWS cursor was placed.
> PCCursor ()
> EndIf
>
> Thanks,
> John

__________�

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

Other related posts: