[jawsscripts] Re: Trying to use Jaws UIA Script API

  • From: Chad Foster <chad.foster@xxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Sat, 1 Feb 2014 17:48:39 -0500

John, do you have the inspect.exe file that you can send me off-list?
I cannot download the Windows SDK here at work on this machine, and I
need that tool to get a map of the UIA tree. Thoughts on mapping out
that tree are appreciated.

Best,

Chad

On 1/7/14, John Robichaud <John_Robichaud@xxxxxxxxxxx> wrote:
> Doug,  Jim, Soronel, and Scott,
> I'm happy to report that as a result of your wise counsel I've got this
> thing working.  The key piece, as was suggested, is grabbing a UIA tree node
> before beginning navigation. Hard to imagine why this is not mentioned in
> the Freedom documentaton as it is critical.  My working code follows:
>
> Var object MyObject, object MyTreeWalker
> Let MyObject = CreateObjectEx("FreedomSci.UIA", false,
> "UIAScriptAPI.x.manifest")
> Let MyTreeWalker = MyObject.ControlViewWalker
> Let MyTreeWalker.CurrentElement =
> MyObject.GetElementFromHandle(GetAppMainWindow(GetFocus()))
>
> MyTreeWalker.GoToFirstChild()
> MyTreeWalker.GoToNextSibling()
> MyTreeWalker.GoToNextSibling()
> MyTreeWalker.GoToNextSibling()
> MyTreeWalker.GoToFirstChild()
> MyTreeWalker.GoToFirstChild()
>
> SayString(MyTreeWalker.CurrentElement.Name)
> MyTreeWalker.CurrentElement.GetInvokePattern().Invoke()
>
> Just so you know, this scripting is to provide direct access to controls in
> the Avaya One-X Agent telephone autodialer. Again, many thanks to all.  This
> may preserve a person's job.
> John
>
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Scott Huey
> Sent: Monday, January 06, 2014 7:52 PM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Trying to use Jaws UIA Script API
>
> I think you may have omitted a step here. The raw FSUIA API interface you
> create with CreateObjectEx is not, itself, a UIA object, it's a raw
> IDispatch implementing COM object. You'll need to grab a UIA tree node
> object as a second step in order to have a TreeWalker enumerate any
> children. Assuming from your navigation that your delved tree fragment
> starts at the Application's window object,
> GetElementFromHandle(GetAppMainWindow (GetFocus())) will probably suffice.
> You'll need to stage it out as Jim suggested, and probably wouldn't hurt to
> have a SayString(MyTreeWalker.CurrentElement.Name) at every step just to try
> tracking out where it's going.
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Snowbarger
> Sent: Monday, January 06, 2014 6:59 PM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Trying to use Jaws UIA Script API
>
> John,  you are outside my experience here.  So, I am following this with
> interest, hoping to learn something.
> So, let us know what eventually works.  Thanks.
>
> ----- Original Message -----
> From: "John Robichaud" <John_Robichaud@xxxxxxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Monday, January 06, 2014 4:44 PM
> Subject: [jawsscripts] Re: Trying to use Jaws UIA Script API
>
>
> Soronel,
> I tried it with CreateTreeWalker and the true condition with the same
> result.  The clue here. I think, is that after using either TreeWalker
> approach, the use of the GoTo methods always return false.  I can't resolve
> that basic problem.
> John
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
> Sent: Monday, January 06, 2014 5:25 PM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Trying to use Jaws UIA Script API
>
> Make sure that CurrentElement is actually set to something before you do the
> series of GoTo calls.  I don't know about ControlViewWalker but I do know
> that when usingCreateTreeWalker with a true condition to enumerate
> everythign that CurrentElement starts out null
>
>
>
> On 1/6/14, John Robichaud <John_Robichaud@xxxxxxxxxxx> wrote:
>> Jim,
>> I tried that as well with no success.
>> John
>>
>> -----Original Message-----
>> From: jawsscripts-bounce@xxxxxxxxxxxxx
>> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Snowbarger
>> Sent: Monday, January 06, 2014 5:01 PM
>> To: jawsscripts@xxxxxxxxxxxxx
>> Subject: [jawsscripts] Re: Trying to use Jaws UIA Script API
>>
>> John,
>> I think he means you need to do your goTo calls separately, in
>> separate statements.
>>
>> MyTreeWalker.GoToFirstChild()
>> MyTreeWalker.GoToNextSibling
>> I am not sure which object is actually changing.  The Tree Walker I
>> guess.
>>
>> ----- Original Message -----
>> From: "John Robichaud" <John_Robichaud@xxxxxxxxxxx>
>> To: <jawsscripts@xxxxxxxxxxxxx>
>> Sent: Monday, January 06, 2014 3:32 PM
>> Subject: [jawsscripts] Re: Trying to use Jaws UIA Script API
>>
>>
>> Doug,
>> I think you mean to do the following:
>>
>> Let MyTreeWalker =
>> MyTreeWalker.GoToFirstChild().GoToNextSibling().GoToNextSibling().
>> GoToNextSibling().GoToFirstChild().GoToFirstChild()
>> SayString(MyTreeWalker.CurrentElement.Name)
>>
>> But this doesn't work either. I have found that using any of the GoTo
>> methods on MyTreeWalker returns false. I have confirmed that the
>> statement:
>> Let MyTreeWalker = MyObject.ControlViewWalker does result in an object.
>> John
>>
>> -----Original Message-----
>> From: jawsscripts-bounce@xxxxxxxxxxxxx
>> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
>> Sent: Monday, January 06, 2014 4:12 PM
>> To: jawsscripts@xxxxxxxxxxxxx
>> Subject: [jawsscripts] Re: Trying to use Jaws UIA Script API
>>
>> The goTo* methods change object state and return boolean, rather than
>> returning a new object. You'll have to make your goto* calls
>> separately, then use MyTreeWalker.currentElement to get at where you
>> landed.
>>
>> On Mon, Jan 06, 2014 at 04:07:37PM -0500, John Robichaud wrote:
>> I'm trying to use the Jaws UIA Script API to speak the name of a
>> pushbutton in an application.  This is Windows 7 and Jaws 15.0.5056.
>> I've used MicroSoft's Inspect tool to reveal the object hierarchy.  My
>> code
>> follows:
>>
>>
>>
>> Var object MyObject, object MyTreeWalker
>>
>> Let MyObject = CreateObjectEx("FreedomSci.UIA", false,
>> "UIAScriptAPI.x.manifest")
>>
>> Let MyTreeWalker = MyObject.ControlViewWalker
>>
>> SayString(MyTreeWalker.GoToFirstChild().GoToNextSibling().GoToNextSibling().
>> GoToNextSibling().GoToFirstChild().GoToFirstChild().Name)
>>
>>
>>
>> I know the name that should be spoken for this element but I get nothing.
>> I
>> suspect that I'm not using the Tree Walker piece correctly. Can anyone
>> help with this?
>>
>> John Robichaud
>>
>>
>>
>> __________???
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>> --
>> Doug Lee, Senior Accessibility Programmer SSB BART Group -
>> Accessibility-on-Demand mailto:doug.lee@xxxxxxxxxxxxxxxx
>> http://www.ssbbartgroup.com "While they were saying among themselves
>> it cannot be done, it was done." --Helen Keller __________o?=
>>
>> 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
>>
>>
>
>
> --
> Soronel Haetir
> soronel.haetir@xxxxxxxxx
> __________?
>
> 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
>
> __________�
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>


-- 
Chad Foster
Access Technology Solutions
Leveling The Playing Field Through Technology
http://www.GO-ATS.net
__________�

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

Other related posts: