[jawsscripts] Re: A script for a results listbox!

  • From: "Jon Squally" <jonsqually@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sun, 30 Aug 2009 14:46:01 -0700

Hello all,

To move to a window of which you know the class, you can use FindWindow ().
Look at the description of this function (Control+i) within the script
manager.  You can press (alt+d) to reach the description field.  The arrow
keys will allow you to read the descriptions after a fashion.  Additionally,
downloading the FSDN is a good idea since you can see functions listed by
category.  

Here is an example script that may work for you.
Script ListOfResults ()
Var
Handle hApp, ;application main window
Handle hFocus, ;window with focus
Handle hListview ;class we are trying to find
Let HFocus= GetFocus()
Let hWND = GetAppMainWindow (HFocus) 
;first get the application main window of the window with focus
;if above does not work try GetRealWindow in place of GetAppMainWindow
;now try to find the window we wish to move focus to.
Let HListView= FindWindow (HApp, "listbox32", CSCNull)
If (HListView)
Then
SetFocus (HListView)
Delay (2,false)
SayString ("Setting Focus")
Else
SayString ("window not found")
Endif ;found window of class listbox32
If GetFocus () == hListview 
then
SayFormattedMessage(OT_NO_Disable,"List of results","") 
EndIf;Focus is list view
EndScript
Another situation may happen where the window cannot directly be focused on
line that.  You may try the following in that case.  
After you determine that you can find the window, 
SaveCursor ()
InvisibleCursor ()
SaveCursor ()
MoveToWindow (HListView)
ClickAtPoint (GetCursorCol (), GetCursorRow (), False)
RestoreCursor ()
Note that the clickatpoint function may not work with the invisible so you
may need to set the third parameter to true to tell Jaws to use the Jaws
cursor when clicking.  
I hope this helps, Jon.

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Mailing Lists
Sent: Sunday, August 30, 2009 11:29 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] A script for a results listbox!

Hi Folks,

I am trying to make a script that will do something like the following for
me. It is a small file search program called Agent Ransack and I want to be
able to jump into the list of results once I have started a search for
particular files on my hard drive. These files can be any such as ".doc,
.xls Etc"
When you have gotten a list of results back, you cannot just tab key into
the list view and arrow through them. I am trying to create a jaws script
that will allow me to jump into the list when the search results come back
to me.
The listbox itself has a class of "listbox32"

I feel embarrassed showing you my script below as I feel it is probably not
in any way too well thought out or written up but maybe someone could advise
me on how to fix it so that I can get to this listbox. While I am getting
focus of the listbox itself, jaws is not actually getting anywhere by
leftmouse button on it like I have written into my script. I have identified
where the leftmouseButton click is hitting and its some kind of label called
"Contents View" which is just a label and doesn't highlight the contents of
the actual listbox when it is clicked on.

Here is my attempt:

Script ListOfResults ()
Var
Handle hWND,
Handle hListview
Let hWND = GetAppMainWindow (GetCurrentWindow()) Let hListview = GetFocus()
PCCursor()
SaveCursor()
If GetFocus () == hListview then
LeftMouseButton()
SayFormattedMessage(OT_NO_Disable,"List of results","") EndIf

EndScript

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

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

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

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

Other related posts: