[jawsscripts] Re: speech truncation

Hi Cearbhal:

I can see why you might be confused about my suggestion of defining a
SayAllStoppedEvent.  This is not something that you call specifically
from your scripts.  This is in fact an event that Jaws will call when
the SayAll stops for whatever reason.

When you see the word Event in a function name, this is an indication
that the function in question will be run or called when a particular
thing happens.  Some other event processing functions are: NewTextEvent
(occurs when new text is written to the screen), KeyPressedEvent (occurs
when a key is pressed).

I was suggesting that you define your own SayAllStoppedEvent in your
scripts.  This would allow you to change the value of a global variable
when the sayAll stops. 

Then in another function that you write, you can check on the value of
this variable.

I suspect that your problem is happening because the delay within your
while loop is not working the way you expect it to.  Maybe your loop is
trying to run the virtualread script again while the sayall is in
progress.

David Farough
Application Accessibility Coordinator/coordonateur de l'accessibilité 
Information Technology Services Directorate /
Direction des services d'information technologiques
Public Service Commission / Commission de la fonction publique
Email / Courriel:  David.Farough@xxxxxxxxxxxxx
Tel. / Tél:    (613) 992-2779 

>>> "Cearbhall O Meadhra" <cearbhall.omeadhra@xxxxxx> 03:59 pm Friday,
October 10, 2008 >>>
Dear David,

I have puzzled over this recommendation of yours for the past week. I
believe you have put your finger on something that will help but I
just
cannot see it. Please forgive me if I ask for some more clarification!

 The problem is that the "say All" function is not completing. In
other
words, the Say all is stopping before it should do so. Why, then, would
I
call a function that stops it?

I like your suggestion about the scheduled event instead of the while
loop.
I will certainly experiment with that and report back as to how it
works
out.  As far as I can see, the scheduled event is to be delayed before
execution. Does that mean that the first run of the event must take
place
before this routine is called?
 

I really appreciate your help with this.
All the best,
 
 
Cearbhall 
 
"Good design enables - Bad design disables"
 
Tel: 01-2864623 Mob: 087 9922227 Em: cearbhall.omeadhra@xxxxxxxxxx 
 

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx 
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of David Farough
Sent: 06 October 2008 18:21
To: jawsscripts@xxxxxxxxxxxxx 
Subject: [jawsscripts] Re: speech truncation

Hi Cearbhal:

I preface this by saying that I have never used the SayAllStoppedEvent
so I
do not have any first hand information to share.

However the following can be found in the FSDN document.

Function: SayAllStoppedEvent
Description
User-defined code can be added to an overwritten version of this
function to
run every time SayAll stops. 

Returns
Type: Void


Parameters 
No Parameters 

Version 
This function is available in the following releases: 

PAC Mate 1.10 and later 
JAWS 4.51 and later 

I was thinking that you might want to set a global variable in this
event that indicates that the SayAll was finished. 

You may need to get creative with regard to your looping structure.

I suspect that trying to perform the script within the loop is causing
problems.

Perhaps you could use ScheduleFunction with an appropriate amount of
time to call a function that you write which would perform the read
script again.  Maybe in this function you would check the value of the
global variable which you set in the SayAllStoppedEvent  if true, then
read again otherwise call a function that will wait a period of time
and
check again.

Here is the info for ScheduleFunction  I think that this might serve
you better than Delay.

You may need to rework your code a bit and remove the loop in the
script.

Function: ScheduleFunction 
Description 
Runs a user defined function in a set period of time. Useful when you
want to perform a task and then check on the results at a later time.
Once this function is used, you can call UnScheduleFunction to cause
the
user-defined event not to run. 

Returns 
Type: Int
Description: An ID that can be used to call UnScheduleFunction. If 0
is
returned, then the timer was not successfully set.


Parameters 
Param 1: 
Type: String
Description: Name of function to be executed.
Include: Required


Param 2: 
Type: Int
Description: Amount of time to elapse before the function is executed.
Time is measured in tenths of a second. A value of 10 is one second.
Include: Required


Version 
This function is available in the following releases: 

PAC Mate 1.10 and later 
JAWS 4.51 and later 
Magic 10.5 and later 

I have done some looking and found an example of coding for the
SayAllStoppedEvent taken from Outlook2007.jss.

Here is the example code.

Void Function SayAllStoppedEvent()
If gbWordIsWindowOwner then
        if IsDocProtected()>=0 then
                QuickNavStateChange(true)
        Else
                QuickNavStateChange(false)
        EndIf
EndIf
default::SayAllStoppedEvent()
EndFunction

Note that the line immediately above the EndFunction explicitly calls
the SayAllStoppedEvent from the Default.jsb


David Farough
Application Accessibility Coordinator/coordonateur de l'accessibilité 
Information Technology Services Directorate /
Direction des services d'information technologiques
Public Service Commission / Commission de la fonction publique
Email / Courriel:  David.Farough@xxxxxxxxxxxxx 
Tel. / Tél:    (613) 992-2779 

>>> "Cearbhall O Meadhra" <cearbhall.omeadhra@xxxxxx> 05:56 pm Friday,
October 03, 2008 >>>
Dear David,

I tried your suggestion of using a pause following the getWindowText
and
after the ExitUserbuffer statement. This caused an immediate
improvement in
the flow of text output by the script "VirtuaReadMode" which functions
as a
single read of one page. The text flows now without any hesitation so
I
think you have definitely improved that part of the problem, thanks!

The  "eBookReadContinuous" script repeatedly calls the
"VirtuaReadMode"
to
generate a continuous flow of text and move from page to page. Here
the
script is moving from page to page correctly but the text being output
from
the "VirtuaReadMode" is still being truncated quite severely.

It appears to me that the looping system is interfering in the
background
somehow. I have increased the delay before launching the call to
repeat
the
"VirtuaReadMode" but this only increases the silence between runs and
does
not stop the truncation.

What is the purpose of the SayAllStoppedEvent?

All the best,
 
 
Cearbhall 
 
"Good design enables - Bad design disables"
 
Tel: 01-2864623 Mob: 087 9922227 Em: cearbhall.omeadhra@xxxxxxxxxx 
 


100 Years Merits a Celebration!  
http://www.psc-cfp.gc.ca/100/index-eng.htm 
100 ans, ça mérite une célébration!    
http://www.psc-cfp.gc.ca/100/index-fra.htm 

__________ 
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 


100 Years Merits a Celebration!  
http://www.psc-cfp.gc.ca/100/index-eng.htm 
100 ans, ça mérite une célébration!    
http://www.psc-cfp.gc.ca/100/index-fra.htm 

__________ 
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: