[jawsscripts] Re: colour checking issue

  • From: Jackie McBride <abletec@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Thu, 6 May 2010 09:16:11 -0700

Hi, Sean:

Colors in Jaws are dodgy at best. I've had quite a bit of experience
w/this sort of thing in a forensics app I've written scripts for, that
did just what you're saying, & I'll tell u what I did, in case it
helps.

1) Be advised that the sayColor() function, called when insert
keyboard 5 is pressed, is notably inaccurate. You'd be better off
creating your own script that says the color at the active cursor
column & row for a particular set of coordinates, using either
GetColorAtPoint or GetColorText. Both functions return an integer, so
use sayinteger to get your return value. Often the color changes in
the middle of the line as opposed to the beginning, so you've got to
locate precisely where that occurs, as well as what color the checked
vs unchecked portion actually is. My guess is that either you've got
the location or the color incorrect.

What u have to do is:
a) Adjust your global mouse pixels to 1 in home row;
b) figure out at what cursor position the text starts at;
c) Go to the beginning of the line, &, for every pixel until the start
of the actual text, get the color for the checked & unchecked state so
u can see where it changes.

As u can see, it is a royal pita! U might actually want to make a
script that does this for u automatically.

I would also advise that u not include this in keypressedEvent, but
actually write a spacebar script for this. That's what I did, & it
worked well.

If u feel I can help u more w/this, let me know & maybe we can do a
skype call or something.

On 5/5/10, sean farrow <sean.farrow@xxxxxxxxxxxxxxxx> wrote:
> Hi:
> I am in the process of checking for a colour in a set of scripts i'm
> writing.
>
> The colour changes when the spacebar is pressed.
>
> I'm currently doing the following in KeyPressedEvent, not the best palce I
> know, I carn't use new text event, asx the whole app is one window, Any
> other events come to mind?
>
> If GetColorAtPoint(x, y) ==Colour then
>
> SayString"test" //simulate the checked state of a checkbox.
>
> Else
>
> SayString "Unckecked"
>
> The if clause seems to execute all the time, but not the else.
>
> Anyone any idea why?
>
> Also should i use colorToRGBString rather than the colour value it'self.
>
> Any help appreciated.
>
> Regards
>
> Sean.
>
>
> __________�
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>


-- 
Change the world--1 deed at a time
Jackie McBride
www.abletec.serverheaven.net
Please join me Saturday, 11/7, on my walk against breast cancer by
making a donation at:
http://main.acsevents.org/goto/larkspur>
__________�

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

Other related posts: