[jawsscripts] Re: Question about the FSDN possible improvements!!!

  • From: Artur Räpp <rtr@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sat, 17 Oct 2020 14:42:49 +0300

Hi,

About accName function. This is part of MSAA and documentation is from 
Microsoft.
https://docs.microsoft.com/en-us/windows/win32/winauto/microsoft-active-accessibility

Artur

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On 
Behalf Of Theodore Cooke
Sent: Saturday, October 17, 2020 2:31 PM
To: jawsscripts@xxxxxxxxxxxxx; Doug Lee <doug.lee@xxxxxxxxxxxxxxx>
Subject: [jawsscripts] Re: Question about the FSDN possible improvements!!!

You ask me to be a little more specific, but perhaps I don't even know what 
question I should be asking. The gist of my concern is that there's a ton of 
default functions that I don't have a clue how to use, and I can't understand 
their documentation. This leads me to think that I'm missing out on a lot of 
the potential of the scripting language outside of the UIA API.

On a related note, what is this accName function? I have not come across it 
before. It is not a default function, nor is it documented in the UIA API. 
Where is it documented?

On 10/16/20, Doug Lee <doug.lee@xxxxxxxxxxxxxxx> wrote:

One of the more confusing things about MSAA was always this duality. 
Beware confusion below for anyone who struggles with this; I write 
this though to further explain things that are possible.

If o is a full MSAA object with three or more descendants which can be 
accessed via childIDs 1, 2, and 3:

o.accChild(3) should return a full descendant object, or nothing if 
there isn't one.
o.accName(3) should return the name of the third descendant if o 
implements that approach, even if there is no full object for it.
o.accNavigate(NavDir_FirstChild, 0) may return childID 1 or the first 
full descendant MSAA object, depending on how o is implemented.

I said "should"; the Microsoft docs for MSAA do prescribe specific 
rules for what should be returned for the various calls, but I have 
found variation among apps on what actually happens. An odd case was 
some apps where
o.accChild(1) would work but o.accNavigate(NavDir_FirstChild, 0) would 
return nothing and o.accName(1) would also not work. I programmed BX 
to say, "Try AccChild," for such cases years ago so I would have a 
better chance of detecting that things could be reached at all.

On Fri, Oct 16, 2020 at 08:56:04PM +0100, Bob wrote:
Ok, just tried it and I don???t seem to be able to!
I have just gone back to an old project and I definitely have used 
this before!
In a Jaws 18 script I wrote I have:

For i = 1 to Tree.accChildCount
   sName = Tree.accName(i)
   sList = sList + sName + ???\007???
EndFor

I don???t get how that would have been working on a commercial script 
in J18 and not now in 2020?

I???m beat!
Use UIA it???s easier ????


On 16 Oct 2020, at 20:23, Bob <temp@xxxxxxxxxxxxxxx> wrote:

???
I am pretty sure that all the values can get the values of the children.

So o.accName(1) is the accName of the first child.
o.accRole(3) is the role of the third child.
o.accName or o.accName(0) is the name for o

If you want to actually get the object though then you have to 
navigate as you suggest.

https://docs.microsoft.com/en-us/windows/win32/api/oleacc/nf-oleacc-i
accessible-get_accname

Bob

On 16 Oct 2020, at 20:08, Snowman <snowman@xxxxxxxxxxxxxxxx> wrote:

???Hey there, is a subtle point here about children,  from Bob's 
message.
Unless I got this totally wrong,  o.accName(3) is not the third 
child of o.
It is a simple element, which is part of o.  So,  objects are 
hierarchically related, just as they are in UIA.  But,  each object 
might also have these simple elements.
That is,  o might have a child, and there is a way to get to it.
Let oChild = o.accNavigate(msaa_navDir_firstChild,objectID)
But, I think that is not the thing that is referenced when you say 
o.accName(1).



+--------------------------------------------------------------------------+
Listen to The Snowman on MushroomFM.com, Saturday evenings, 8PM 
Eastern time.
60's and 70's tunes, and gently conservative talk.

----- Original Message -----
From: "Bob" <temp@xxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, October 16, 2020 10:17 AM
Subject: [jawsscripts] Re: Question about the FSDN possible 
improvements!!!


MSAA is fairly arduous compared to uia.
If you want other than the object with focus then you have to do the 
same as uia tree walking to get to what you want.

The info you can get on any object is the same as the 
GetLegacyIAccessiblePattern properties.

The one bonus is if you do o.accName(3) you get the name of o???s 
third child so you don???t have to walk for the children of an 
object.

I always have to look up how to get the first object though to start 
off as I use it so rarely.

Bob

On 16 Oct 2020, at 15:31, Theodore Cooke <theodorecooke@xxxxxxxxx>
wrote:

???Thank you to Bob and Chaba for trying to answer my question.
However,
you accidentally answered the opposite of my question. I already 
understand how to use UIA, but I do not understand how to do any 
scripting that uses MSAA or com elements etc. These are most of the 
scripts in the default jss files, and I struggle to understand what 
they are doing. Are there any tutorials that explain how com 
elements etc work, or any tips for understanding these older styles of 
scripts?

On 9/27/20, Udo Egner-Walter <udo.egner-walter@xxxxxx> wrote:
Hi Csaba,

again thank you very much for your comments.

Once again you can see that creating scripts for others means more 
work.
While creating the scripts itself can be quite fast sometimes it 
is on the other hand very time consuming to create the 
documentation and to follow the standards of FS regarding JSD 
files and the like.

Thanks a lot for the hints that help me a lot and simplify the 
creation of scripts.

Best regards
Udo

Am 26.09.2020 um 19:59 schrieb Csaba ??rp??dh??zy-Godo
<arpadhazi68.jawsul@xxxxxxxxx>:

Hi Udo,

Control + W saves the active file without compiling namely 
without creating a binary script file. Control + S saves it with 
compiling, so it creates the JSB file, too.

One would think that these two menu commands work similarly, but 
practice shows that they do not. If you save the file without 
compiling by first synchronizing it with the documentation (Alt + 
F, D command), the entries will normally be included in the JSD 
file. that is, the parameters of the functions, their possible 
optionality. If you do the same with the Control + S command, the 
JSD file will contain only two lines of functions in most cases. 
An example to understand:

1. the contents of the script file that I wrote into it manually 
and did not use the Add New Function dialog.

string Function AddItemToList (int ItemID, string ItemName)

EndFunction

int Function SelectItem (int ItemId, optional int DeselectIt)

EndFunction

2. I sync the file with the documentation. That is, I choose 
Synchronize Documentation from the File menu.

3. I saved the changes.

3.1: In case of Control + W - save without compilation, the 
content of the JSD file in 95% of cases will be:

: function AddItemToList
: Returns string
: SearchRank 1
: Param int / ItemID
: Param string / ItemName

: function SelectItem
: Returns int
: SearchRank 1
: Param int / ItemId
: Optional
: Param int / DeselectIt

3.2 In the case of using Control + S, namely saving our file with 
compiling the JSD file in most cases will only contain the 
following
lines:

: function AddItemToList
: SearchRank 1

: function SelectItem
: SearchRank 1

As I wrote, the practice for me to create the documentation was 
that once I am done with the script file, (that is, I no longer 
write new scripts and functions,) I open it in the Script Manager 
and after synchronizing the documentation I save with Control + 
W. Then, if the file doesn't contain a lot of declarations (about 
10-15 scripts / functions), I use F2 to jump to the first line of 
inputs and press Control + S. In the dialog that appears, I fill 
in the fields on the first tab. I don't touch the Parameters tab. 
When I'm done, I go down and pess OK. Than F2 again, then Control 
+ D. After about 3-4 declarations, I usually save with Control + 
W so that the JSD entries from the memory are included in the JSD file.

If my file contains more than 15 declarations, I will manually 
edit the JSD file. In this case, I close the JSS file and open 
JSD. With Control
+ N, I open a new, empty document in Cript Manager (it can be any
file
type, since I didn't save it anyway, I just use it as a 
clipboard) and create the necessary block to insert after the: 
SearchRank line:

: Synopsis [Short description of the function / script]
: Description [Detailed description of the function / script. 
This will appear in the Shift + F1 keyword help.]
: Category [Category of the given function / script]

Then I put these 3 lines on the clipboard, and then I start 
editing the JDF file. That is, I hit Enter at the end of the: 
SearchRank line, then I paste the above 3 lines with Control + V, 
and then fill it out. I also fill in the parameters. In other 
words, I include their descriptions one by one here as well.

I repeat these steps until the last declaration.

Namely, according to my observations, if a script file contains 
more declarations than 15 and I create the documentation using 
the panel that can be called with Control + D, then after a 
while, approx. 20 declarations, SCript Manager crashes during 
saving process. The JSD file is saved completely blank. There may 
be some sort of memory management bug in the script manager. But 
it's been a long time since I've had similar issues with version 
11.

HTH

Chaba


2020. 09. 26. 17:29 keltez??ssel, Udo Egner-Walter ??rta:
Hello, Chaba,

First of all, many thanks for this detailed explanation and the 
tips it contains. I always think it's absolutely great how you 
and all the others (Bob, Doug, Snowman, just to name a few) give 
expert advice here. I would therefore like to thank you on 
behalf of all the others.

One more question: Under 2. you write that you press Ctrl+W to 
update the JSD file. But doesn't Ctrl+S do the same?

Best regards
Udo

Am 24.09.2020 um 21:23 schrieb Csaba ??rp??dh??zy-Godo
<arpadhazi68.jawsul@xxxxxxxxx>:

Hi Udo,

of course you can ask. That is why this list is. :-)

I can understand that you hate to create functions / scripts 
with the "Insert new script" dialog. Whoever created the JAWS 
script editor's dialogs had no faint idea of ??????what the 
terms ???user-friendly??? and ???ergonomic??? mean.
I think, most of scripters create their functions smoothly, 
simply by typing them into the editor. In this case, the script 
editor - unfortunately - is not "informed that a new script / 
function has been created. So it is not included in the 
documentation file.

In this case, if we press Alt+F than D (File menu > Synchronize 
documentation command) than the script editor usually updates 
the JSD file. However, in the vast majority of cases, does it 
incorrectly.
Usually forgets to add the parameters of the functions.

For this reason, I always edit the JSD file manually. And most 
of the time in the script editor. There are a few tricks to 
look out for:

1. Opening JSS Script Manager loads a copy of JSD into the 
memory.JSD

When you open a script file (JSS), the script editor loads the 
contents of the JSD file into the memory. If you edit a JSD 
file with the corresponding JSS file being opened, make sure 
that the script editor does not update the information loaded 
into memory when saving the JSD file. Therefore, if you save 
the JSS file, some of your changes to the JSD file will be 
lost. Therefore, while I am editing the JSD file, I will never 
modify the JSS, or if I finish modifying the JSD, I will close 
both files and only then start modifying the JSS again if I 
reopen it.

2. Use Control+D (Edit script dialog) to spare work.

As I mentioned I write my scripts/functions per hand, too. When 
I wrote the framework for the new function (the declaration and 
closing lines - "xxx function xx (params) / EndFunction") than 
I always save my work by pressing Control + W (Save without 
compiling). It ensures, that the Script manager uptates the in 
memory copy of JSD file when saves my new function framework.

3. When I finis a script file, I always take time to document 
my scripts & functions. It means I fill the ":Synopsis, 
:Description & :Category"
fields in the JSD file.  To do it I use the Control+D (Edit 
script dialog). Only in the case if my function has optional 
parameter do it by hand.
This is because you cannot enter optional parameters via this 
dialog.
Thus, if you edit a function that has such a parameter, the 
optionality is lost.

4. Descriptions of parameters

I do it always by hand in the JSD file.

By the way, the Control + e (Add new script) / Control + D 
(Edit
script)
dialogs has some errors in their functioonality. For example: 
you can't make a parameter optional, if you edit a function 
that has already a short description, the dialog does not shows 
it. The same with the category, and the return walue. You can't 
edit existing parameters,
etc.)

HTH
Chaba



2020. 09. 24. 16:37 keltez??ssel, Udo Egner-Walter ??rta:
Hi Csaba and list members,

I would like to ask another question off topic if I may.

To make entries in the JSD file yourself, you can press Ctrl+D 
in a script/function and fill in the necessary fields. 
However, I find it quite complicated to change or create 
functions using this.

Personally, I prefer to create the functions "by hand" and 
would therefore have the question: is it possible to open the 
JSD file with an editor and make the entries myself? Is there 
anything special to consider here?  How do you do that, e.g. 
to store a description for a parameter?

Up to now I have always edited the JSD file with an editor for 
scripts, but I haven't dared to use the functions yet. Does 
anyone have any suggestions, instructions or general ideas?

Thanks for suggestions
Udo

Am 24.09.2020 um 11:35 schrieb Csaba ??rp??dh??zy-Godo
<arpadhazi68.jawsul@xxxxxxxxx>:

Theodore,

Bob is right. But instead of JSS you have to add the JSD file 
to your script whre you would like to use UIA functions. So 
the correct line you have to insert is:

Import ???uia.jsd???

Studying the code in the UIA.jss file you can get many 
examples how to use UIA.

HTH

Chaba

2020. 09. 23. 12:16 keltez??ssel, Bob ??rta:
Add the line:
Import ???uia.jss??? to your jss file.
Save, close and reopen script manager.

Then take a look at the functions that appear in the insert 
function dialog that start fsuia.

You can also look in uia.jss at what they are doing.

Bob

On 23 Sep 2020, at 10:28, Theodore Cooke 
<theodorecooke@xxxxxxxxx>
wrote:

???Csaba, are there any shared scripts you think are a 
great starting point? I have learned how to write scripts 
that interact with Microsoft UI Automation, but I still 
haven't learned how to use the vast majority of the 
functions in the insert functions dialog.
They
mostly seem to use MSAA, but I just can't get the feel for 
MSAA.

On 9/12/20, Csaba ??rp??dh??zy-Godo 
<arpadhazi68.jawsul@xxxxxxxxx>
wrote:
Reed,

These script are in the shared scripts folder of the JAWS. 
You can find them in version 2020:

C:\ProgramData\Freedom Scientific\JAWS\2020\Scripts

HTH

Chaba


2020. 09. 11. 17:48 keltez??ssel, Reed ??rta:
Hi Chaba,

Where might one find these "JAWS shared scripts"?

Thanks!

Reed
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx 
<jawsscripts-bounce@xxxxxxxxxxxxx>
On Behalf Of Csaba ??rp??dh??zy-Godo
Sent: September 11, 2020 5:28 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Question about the FSDN 
possible improvements!!!

Hi Shan,

If you need code samples, than you have to study JAWS 
shared scripts.
They are inexhaustible collections of examples!
By the way, you can contact Vispero and could buy some 
overpriced script writing training materials. But they 
contain "common script writing guidelines" only.

On the other hand, the new FSDN much better than the 
previous ones! You have to download it and look!

Chaba


2020. 09. 10. 19:58 keltez??ssel, Shan Noyes ??rta:
Hi folks
A few years back I purchased an excellent Jaws course 
from Jackie Mcbride.  Anyways, in the course she 
mentions and as I have discovered that the FSDN is a 
pretty good resource, however, it does have some short 
comings.  I agree with that statement coming from IBM 
Screen Reader days and writing profiles because the 
programming supporting manuals actually provided 
examples of code for each IBM screen reading function 
etc.  Note the FSDN  does not due that at all.

So I'm writing and asking if anyone is familiar with any 
such improvements to the FSDN like manual from Freedom.

Thanks all and have a good day.



Shan Noyes
Technical Analyst - Systems Security GIAC
W: 306 777-4830
C: 306 533-1440

NOTICE: This confidential e-mail message is only for the 
intended recipients. If you are not the intended 
recipient, be advised that disclosing, copying, 
distributing, or any other use of this message, is 
strictly prohibited. In such case, please destroy this 
message and notify the sender.

__________???

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


__________???

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

__________???

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


__________???

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

--
Doug Lee, Lead Accessibility Architect Level Access - over 1,000 
organizations trust us to help them achieve and maintain digital 
accessibility compliance!
mailto:Doug.Lee@xxxxxxxxxxxxxxx  http://www.LevelAccess.com "While ;
they were saying among themselves it cannot be done, it was done."
--Helen Keller
__________ 

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: