[jawsscripts] Re: Learning to find information with script utility mode

  • From: "Travis Roth" <travis@xxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 17 Jul 2020 10:28:49 -0500

Hi, 
Understood. The thing to realize, in my opinion, is JAWS scripting is at times 
an art as much as a science. The key I've found is to figure out where the pice 
of info you want is hiding, then figure a path to get to it programmatically. 
Step 1 is to figure out where the info is and what technology will get there. 
Is it a classic app so old windowing tools work? Or slightly more modern and 
MSAA? 
Or  in the case of VS UIAutomation is how it exposes accessibility. And as one 
fellow poster mentioned, if that doesn't work you can dive into COMM 
interfaces, etc. For web apps, sometimes looking at the HTML or DOM, although I 
find looking at the UIA from Chrome or Firefox to be easier a lot of times 
anymore.

In the case of VS 2019 my advice is to find a tool you are comfortable with 
that allows you to explore the UIA tree. I use accVerify which at least used to 
be buried in the Windows SDK somewhere. I believe Accessibility Insights has 
this info to but I do not understand it's interface. 
SO once you find your UIA tool of choice, you just have to start exploring 
until you find the info you want, if it exists. 
A shortcut is to have the tool track the focus or mouse and that gets you to 
the place in the tree automatically, but I rarely can get this to work and 
usually browse the tree by hand. (It really helps if you have access to a 
sightling.)

In the case of the line number for example, in a C# project with program.cs 
open, it appears to be located at 
"Desktop 1" pane > "test - Microsoft Visual Studio" window > "" pane > "" tab > 
"program.cs" tab item > "program.cs" pane > "program.cs" pane > "" custom > 
"Ln: 6" text

From here you need to work out an algorithm to reliably get to this object. The 
text is in a rather benign text node, so this is probably going to be a 
challenge.
Try to isolate it as much as you can, and as last resort walk the tree and look 
for the value that matches what you're looking for. 
For example in this instance, I'd start at the application root, then search 
for the tab object, then from that object search for pane, and then possibly 
the child pane of that pane, and then eventually load up all the remaining text 
nodes and look through them for something containing "ln". And possibly while 
doing this I'd happen across a shortcut or helpful clue to make it simpler.

I'm not going to write a discord on navigating and using UIA, there are various 
messages over the years in this list's archive that help, and honestly a lot of 
time it is trial and error. At least for me. 
 Others who do this more may have better methods, I do not script all that much 
these days. 

Now after you have all that you have to decide how you want JAWS to read it. 
DO you just want it on demand when you press a script key? That's pretty easy. 
Just make a script and define a key. 
Or if you want it to read automatically then you have to find what event is 
being triggered and override it.
For example, this may be handy to be announced with the JAWS status line 
reading command, so override that script (SayBottomLineOfWindow).

Bottom line from me though is the hard part is finding where the info is hiding 
and reliably getting at it.

Not sure if this is at all helpful.
Travis

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On 
Behalf Of Theodore Cooke
Sent: Thursday, July 16, 2020 1:51 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Learning to find information with script utility mode

I am using C# as well.

I am likewise able to show line numbers as you are, but I also don't like 
having them be read every time I up or down arrow. I swear the line number is 
always displayed somewhere on the screen, but I am not sure where I read that. 
Either way, this is just one example of the many things I have tried but failed 
to do with jaws scripting. The main thing I am asking for is general help with 
getting the hang of scripting.

On 7/16/20, Travis Roth <travis@xxxxxxxxxxxxxx> wrote:

Hi,
Visual Studio 2019 is certainly going to be a difficult thing to 
script. I suspect the utility mode scripts will be of limited use as 
they focus on old style windows and have some MsAA, whereas the VS 
accessibility is primarily via UIAutomation.

What language in Visual Studio 2019 are you using?
I opened a C# project and when I enabled show line numbers under 
Options > Text Editor > All Languages, the numbers are shown at the 
left margin and JAWS reads them.
This does not seem ideal to me to have them constantly announced, but 
where else are they shown? How do you have yours configured?
Travis


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx 
<jawsscripts-bounce@xxxxxxxxxxxxx> On Behalf Of Theodore Cooke
Sent: Thursday, July 16, 2020 1:11 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Learning to find information with script 
utility mode

Hello hello.

I have tried many times to get the hang of writing jaws scripts, but 
it just has not clicked for me. I wouldn't say this is because of any 
lack of technical ability. I am a software developer by trade.
However, every time I have found a situation where jaws isn't speaking 
all that I would like, I have not been able to figure out how to get 
that needed information. maybe it is because that by some terrible 
accident, I have only tried to write scripts for applications that are 
inherently unaccessible, but I have now tried to do this with so many 
applications that I feel I must just be missing the boat on some important 
detail.

My current task at hand is creating a hotkey in visual studio to read 
the current line number, but I can't find how to read that using 
either script utility mode or by navigating around using the cursors.
Would somebody be able to walk me through how they use the script 
utility mode to find their desired information? I would greatly 
appreciate that. I'm sure that just as soon as this clicks for me, 
I'll be off to the races and writing all sorts of scripts.
__________

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: