[jawsscripts] Re: Scripting A Labeled Graphic

  • From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 24 May 2013 10:44:18 +1000

hahahaha As usual of late, :) I seem to be having similar solution thoughts 
to Jim, just that he gets there somewhat ahead of me. <bgrin.> of course 
this is indeed as it should be. :)

So yep, regarding the Invisible vs JawsCursor issue, as it pertains to 
graphics and their labels.
This's what I was gunna highlight stephen as well, to be all too jolly aware 
of. this behaviour of an application potentially altering of a graphic's 
number/label, when the jawsCursor/mouse is hovering over it, compared to 
when it's not.
And the subsequent importance of the determination of which cursor your 
using to search for the graphic.
and the definite knowledge of whether this is,  or is not the case, with 
your particular graphic's situation.
coz it's pretty common and happens a lot!

BTW this behaviour can change from graphic to graphic within a single 
application also.

And it can sure mess with your head bigTime if one isn't aware of this!
E.g. that if your particular graphic is behaving in this way,
when the jaws cursor/mouse, is hovering over an as yet unlabelled graphic, 
it may be identified as one particular graphic number, when using 
jawsKey+NumPad 5, (or Caps+K in laptop layout,)
to query it. But, that, say, if you then move the jaws cursor one 
word/braphic to the left, with insert+LeftArrow, then move it back again one 
word to the right, to again locate the graphic you were first interested in, 
as it navigates to that graphic, presumably dependant on speed/timing of 
one's machine,
you may hear Jaws identify it as a totally diferent unlabelled graphic 
number, than it previously had before!
And you think your going mad, concluding that graphic's just disappeared!
But then, whilst sitting on it, if you once again query it with SayWord, it 
will revert back to the original graphic number it had first.
I conclude this somewhat unsettling anomaly occurs, just due to the time it 
takes for the graphic to change it's state, as a result of the 
mousePointer/jawsCursor hovering over it.

Jim's already provided the solution to this, so I don't need to go over 
that.

Only to additionally note, for what it may be worth, that I've also seen 
situations where a single graphic, can sometimes occupy/comprise a unique 
childWindow of it's very own.
in which case, using a setting of s_Restricted, from an application window, 
assuming the handle is correctly obtained for the search, may also block it 
from being located, if the parameter behaves as advertized, and prevents 
entry into any other child windows of that application window?

hth.

----- Original Message ----- 
From: "Jim Snowbarger" <Snowman@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Thursday, May 23, 2013 1:11 PM
Subject: [jawsscripts] Re: Scripting A Labeled Graphic


> I'm a bit surprised by Steven's report about the success depending on the
> cursor position.
> That script should not care about cursor position.
>
> Make sure the jaws cursor is active before you do findGraphic.  I don't 
> know
> if it activates it on it's own.
>
> But, there is also the phenomenon where a graphic changes appearance when
> the mouse is over it.
> So, if you label the graphic with the jaws cursor, then move the jaws 
> cursor
> away, the graphic changes appearance, and searching for that label will no
> longer work.
> To fix that, move the jaws cursor well out of the way, find the graphic 
> with
> the invisible cursor, and label it again, with the same exact label.
>
> ----- Original Message ----- 
> From: "Travis Roth" <travis@xxxxxxxxxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Wednesday, May 22, 2013 7:27 AM
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
>
> Your logic seems good to me.
> However, if there is some issue with tracking focus in this application
> perhaps GetFocus() is failing? Have you tried GetCurrentWindow()?
> Also since you are searching the main window, perhaps set the restriction 
> of
> the FindGraphic() function to S_RESTRICTED? I am not sure if this would
> matter and it shouldn't but sometimes a combination of things makes JAWS
> behave.
>
> Another thing to consider, does it work or fail depending on what cursor 
> is
> active when you launch the script? If the PCCursor does have working 
> focus,
> use the function PCCursor() in your script to ensure that cursor is 
> active,
> in case you've left the JAWS cursor on before calling the script.
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Hicks Steven
> (CORNWALL IT SERVICES)
> Sent: Wednesday, May 22, 2013 2:25 AM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
> Hi Jim
>
> My script is below:
>
>
> var
>    handle hwnd
> Let hwnd = GetAppMainWindow (GetFocus()) if (FindGraphic (hwnd, "Next
> Record", S_TOP, S_UNRESTRICTED)) THEN
>    SayString ("it worked")
> LeftMousebutton()
> else
>    SayString ("not so lucky")
> endif
> EndScript
>
> I have done some further testing and when the script doesn't work, the 
> first
> co-ordinate when using alt+del to find the cursor is less than the value
> when it does work so I am thinking that the cursor is outside of the 
> window
> or application where it needs to be.
> I can also move the cursor in the script manually which should work fine 
> but
> I would be interested in anything that you can tweek the script with to
> automate it?
>
> I am really grateful for all your help and please excuse my ignorance, I 
> am
> not advanced in scripting to say the least.
> This sounds like a simple script but it saves so much time when using the
> application to navigate around my work list.
> If the application had written in their own shortcut key, it would be much
> easier but there is no way to customise this, I have checked.
>
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Snowbarger
> Sent: 22 May 2013 03:09
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
> Depends on how you are getting that handle.  What did you settle on?
> If you use GetCurrentWindow then, the handle you get depends on where the
> active cursor is located when you run the script.
> Most folks on this list would probably gag and the lack of elegance of it.
> But, combining your scripts so your cursor first moves to a fixed set of
> screen coordinates, then doing GetCurrentWindow to get the handle, then
> searching that handle for the graphic,  might work just fine for you. 
> That
> approach is less stable, prone to breakage as things move around.
> Personally, I would try the
> GetAppMainWindow (GetFocus() approach.
> Don't forget to say S_UNRESTRICTED so the search will include all child
> windows.
>
>
>
> ----- Original Message -----
> From: "Hicks Steven (CORNWALL IT SERVICES)" <steven.hicks@xxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Tuesday, May 21, 2013 5:10 AM
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
>
> Hi,
>
> Thanks to everyone's help, I am almost there now.
> Just something that seems quite simplet that I need to try to resolve if
> anyone can help further.
>
> Basically I have a script already that manually moves the JAWS cursor to 
> the
> labelled graphic, this just moves to the screen location.
> If I use this script first then subsequent executions of my new script 
> work
> but the first time, the new script doesn't work.
> Could the focus be outside of the window that I am trying to search
> initially until I use the old manual script to place it there?
> Does anyone know how I may be able to rectify this?
> I would like to use the new script eventually to replace the old manual 
> one
> so that if the labelled graphic actually moves or you change the screen
> resolution, it should still work if that makes sense?
>
> Thanks again for all your help.
>
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Snowbarger
> Sent: 21 May 2013 02:22
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
> Yes,  that is one approach.
>
> Or, if the application main window, and all of it's chilcren is what you
> want to search, you might say something like
>
> var
>    handle hwnd
>
> Let hwnd = GetAppMainWindow (GetFocus()) if (FindGraphic (hwnd, "my 
> Graphic
> name", S_TOP, S_UNRESTRICTED)) THEN
>    SayString ("it worked")
> else
>    SayString ("not so lucky")
> endif
>
> HTH
>
> ----- Original Message -----
> From: "Hicks Steven (CORNWALL IT SERVICES)" <steven.hicks@xxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Monday, May 20, 2013 2:03 AM
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
>
> So I would set up a script with a int and then call get current window and
> use that in my findgraphic statement replacing the int for the window
> number?
>
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Snowbarger
> Sent: 19 May 2013 03:47
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
> Stephen, the first parameter to FindGraphic  in your script is set to 1,
> which is almost certainly not a valid window handle.   Even if it were,
> window handles typically change all the time.  So, you can never count on
> them being a particular number.
> You can get a handle several different ways, and which way to use depends 
> on
> what is convenient in your situation.
> If you can get the jaws cursor placed somewhere in that windwo, you can 
> call
> GetCurrentWindow.
>
>
>
> ----- Original Message -----
> From: "Hicks Steven (CORNWALL IT SERVICES)" <steven.hicks@xxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Friday, May 17, 2013 3:49 AM
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
>
> Hi,
>
> My script is below but for some reason, it doesn't appear to do anything,
> does anyone have any suggestions please?
>
> Script TestFindGraphic ()
> FindGraphic(1,"Previous Record",S_top,S_Unrestricted) EndScript
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Snowbarger
> Sent: 17 May 2013 03:22
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Scripting A Labeled Graphic
>
> Try the FindGraphic function.
>
> ----- Original Message -----
> From: "Hicks Steven (CORNWALL IT SERVICES)" <steven.hicks@xxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Thursday, May 16, 2013 7:27 AM
> Subject: [jawsscripts] Scripting A Labeled Graphic
>
>
> Hi friends,
> I have a button which has had to be a manually labelled graphic, I don't
> think that it is a standard control.
> Does anyone know if I could write a script to mouse the mouse pointer to
> this graphic and check if it is there, if it is, I would like to click the
> left mouse button to press it.  If it is not there, not bothered for now 
> if
> the script just does nothing.
> The Button is called Next Record if that helps.
> At the moment, I just manually move the JAWS cursor to the location on the
> screen, this seems to work quite effictivly unless the screen resolution
> changes of course but I am happy with this for now as I have tried to 
> write
> a find script to look for the labelled graphic before but coldn't get it 
> to
> work.
>
> Any help would be much appreciated.
>
> Steve.
>
> ****************************************************************************
> ****************************************
>
> This message may contain confidential information. If you are not the
> intended recipient please inform the sender that you have received the
> message in error before deleting it.
> Please do not disclose, copy or distribute information in this e-mail or
> take any action in reliance on its contents:
> to do so is strictly prohibited and may be unlawful.
>
> Thank you for your co-operation.
>
> NHSmail is the secure email and directory service available for all NHS
> staff in England and Scotland NHSmail is approved for exchanging patient
> data and other sensitive information with NHSmail and GSi recipients 
> NHSmail
> provides an email address for your career in the NHS and can be accessed
> anywhere
>
> ****************************************************************************
> ****************************************
>
> __________�
>
> 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
>
>
> ****************************************************************************
> ****************************************
>
> This message may contain confidential information. If you are not the
> intended recipient please inform the sender that you have received the
> message in error before deleting it.
> Please do not disclose, copy or distribute information in this e-mail or
> take any action in reliance on its contents:
> to do so is strictly prohibited and may be unlawful.
>
> Thank you for your co-operation.
>
> NHSmail is the secure email and directory service available for all NHS
> staff in England and Scotland NHSmail is approved for exchanging patient
> data and other sensitive information with NHSmail and GSi recipients 
> NHSmail
> provides an email address for your career in the NHS and can be accessed
> anywhere
>
> ****************************************************************************
> ****************************************
> __________�
>
> 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
>
>
> ****************************************************************************
> ****************************************
>
> This message may contain confidential information. If you are not the
> intended recipient please inform the sender that you have received the
> message in error before deleting it.
> Please do not disclose, copy or distribute information in this e-mail or
> take any action in reliance on its contents:
> to do so is strictly prohibited and may be unlawful.
>
> Thank you for your co-operation.
>
> NHSmail is the secure email and directory service available for all NHS
> staff in England and Scotland NHSmail is approved for exchanging patient
> data and other sensitive information with NHSmail and GSi recipients 
> NHSmail
> provides an email address for your career in the NHS and can be accessed
> anywhere
>
> ****************************************************************************
> ****************************************
> __________�
>
> 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
>
>
> ****************************************************************************
> ****************************************
>
> This message may contain confidential information. If you are not the
> intended recipient please inform the sender that you have received the
> message in error before deleting it.
> Please do not disclose, copy or distribute information in this e-mail or
> take any action in reliance on its contents:
> to do so is strictly prohibited and may be unlawful.
>
> Thank you for your co-operation.
>
> NHSmail is the secure email and directory service available for all NHS
> staff in England and Scotland NHSmail is approved for exchanging patient
> data and other sensitive information with NHSmail and GSi recipients 
> NHSmail
> provides an email address for your career in the NHS and can be accessed
> anywhere
>
> ****************************************************************************
> ****************************************
> __________�
>
> 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
>
>
> ****************************************************************************
> ****************************************
>
> This message may contain confidential information. If you are not the
> intended recipient please inform the sender that you have received the
> message in error before deleting it.
> Please do not disclose, copy or distribute information in this e-mail or
> take any action in reliance on its contents:
> to do so is strictly prohibited and may be unlawful.
>
> Thank you for your co-operation.
>
> NHSmail is the secure email and directory service available for all NHS
> staff in England and Scotland NHSmail is approved for exchanging patient
> data and other sensitive information with NHSmail and GSi recipients 
> NHSmail
> provides an email address for your career in the NHS and can be accessed
> anywhere
>
> ****************************************************************************
> ****************************************
> __________�
>
> 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
>
>
>
> __________�
>
> 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

Other related posts: