[jawsscripts] Re: Finding A Graphic Script

  • From: Jackie McBride <abletec@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Wed, 18 Jul 2012 11:19:47 -0700

Steve, let's do this:
Script NextCall ()
If (FindGraphic(0,"Next Call",S_Top,S_Unrestricted)) then
SayString("Next Call")
else
saystring("no next call.")
EndIf

That way, we can test whether the script actually fires but is simply
not finding the graphic. My advice is that u always consider these
types of contingencies, & build them in from the get-go.

2nd, make very very sure that the graphic label & the search string of
your script match precisely, i.e., next call & NextCall are not the
same, & if the case differs, the label won't be found.

If the script is in fact firing, & the label & find search strings
indeed match, then the next thing to explore is the issue of the
window handle. I generally try GetAppMainWindow(GetCurrentWindow())
first, but this is an area that can require a good bit of
experimentation & downright hair-pulling (ask me why mine's always
short).

On 7/18/12, Steven Hicks <Steven.HicksSM@xxxxxxxxxxxxx> wrote:
> You are really helpful, is there a way that I can find the handle of the
> window?  This could well be my issue.
> I understand the concept of a boolean now, from the days of old and my
> PASCAL programming :-)
>
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jackie McBride
> Sent: 18 July 2012 15:49
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Finding A Graphic Script
>
> Steven, this is in essence a boolean, so basically, if the graphic is found,
> it returns true--false otherwise. If you're thinking it returns the
> graphic's crc or something like that--no-it doesn't--& I actually don't know
> of any Jaws function that does, probably because its usefulness is
> questionable.
>
> If you're having trouble consistently finding the graphic, then remember the
> first parameter represents the handle of the window you're searching in, &
> therefore is configurable. If 0, which represents a top level window, is not
> what u need, you're at liberty to experiment w/that until u find the
> graphic. That often needs to be done in situations like this.
>
> HTH.
>
> On 7/17/12, Steven Hicks <Steven.HicksSM@xxxxxxxxxxxxx> wrote:
>> Ah ha, that could be useful, thank you very much, could I capture the
>> integer that it returns?
>>
>>
>> -----Original Message-----
>> From: jawsscripts-bounce@xxxxxxxxxxxxx
>> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jackie McBride
>> Sent: 18 July 2012 00:11
>> To: jawsscripts@xxxxxxxxxxxxx
>> Subject: [jawsscripts] Re: Finding A Graphic Script
>>
>> Steven, remember that FindGraphic returns an integer. So:
>> if (                FindGraphic(0,"Next record",S_Top,S_Restricted)) then
>>    LeftMouseButton()
>> endif
>>
>>
>> On 7/17/12, Steven Hicks <Steven.HicksSM@xxxxxxxxxxxxx> wrote:
>>> Hi friends,
>>>
>>>
>>> I have an application which has a line of four buttons which don't
>>> appear to be standard graphical buttons, they are graphics which I
>>> have to manually label.
>>>
>>> I have written a script using the FindGraphic(0,"Next in
>>> list",S_Top,S_Restricted). key word and it seems to work and find
>>> the graphic fine.
>>>
>>> I would like to expand this script so that I can confirm that I am on
>>> the graphic and if so, I would then like to perform a left mouse
>>> botton to click it.
>>>
>>> Does anyone have any suggestions on how I may do this please?
>>>
>>> My script looks like the following at the moment:
>>>
>>>
>>>
>>> Script(NextRecord)
>>>
>>>                 FindGraphic(0,"Next record",S_Top,S_Restricted)
>>>
>>> EndScript()
>>>
>>>
>>>
>>> Any help would be much appreciated,
>>>
>>>
>>>
>>> Steve.
>>>
>>>
>>>
>>> P.s.  I could even consider using the IfSameKey I think it is so that
>>> I press the assigned shortcut key twice to execute the left mouse
>>> button.
>>>
>>>
>>>
>>> Take care all.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> __________
>>>
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/jawsscripts
>>>
>>>
>>
>>
>> --
>> Blame the computer--why not? It can't defend itself & occasionally
>> might even be the culprit Jackie McBride Ask Me Computer Questions at:
>> www.pcinquirer.com Jaws Scripting training materials:
>> www.screenreaderscripting.com
>> homePage: www.abletec.serverheaven.net __________
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>>
>>
>> __________
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>>
>
>
> --
> Blame the computer--why not? It can't defend itself & occasionally might
> even be the culprit Jackie McBride Ask Me Computer Questions at:
> www.pcinquirer.com Jaws Scripting training materials:
> www.screenreaderscripting.com
> homePage: www.abletec.serverheaven.net
> __________
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>
>
> __________�
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>


-- 
Blame the computer--why not? It can't defend itself & occasionally
might even be the culprit
Jackie McBride
Ask Me Computer Questions at: www.pcinquirer.com
Jaws Scripting training materials: www.screenreaderscripting.com
homePage: www.abletec.serverheaven.net
__________�

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

Other related posts: