[jawsscripts] Re: Jaws reloading after script has run too long

  • From: "John Aaron" <massageinlargo@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 23 Apr 2015 14:24:54 -0400

I just wanted to thank everyone for the help, and pass on what I worked out
as a solution with the help that everyone provided in case anyone else runs
into this before Freedom Scientific works out this bug.

. I had created a global variable called: sOldPage, along with a
couple of variables needed for my script.
. When I run the script I initialize the sOldPage with the name of the
page.
. In the event handler for the document loaded I put a check to see if
sOldPage has a value.
. If it does I get the name of the new page and compare it to the
sOldPage.
. If it does then I run a function that checks a couple of other
variables to be sure you are still on the same site, the script didn't
terminate in the middle last time it was run, etc.
. Once I am sure that it functioned as planned I continue with another
function that processes the data as I needed.
. Then before I terminate the script I reset all the global variables
to nothing.

Once again, thanks to everyone for their help. This was a much better
solution than holding up jaws while waiting on the program.

John


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
Sent: Wednesday, April 22, 2015 10:07 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Jaws reloading after script has run too long

Globals survive until the next JAWS restart, in case that helps any.

On Wed, Apr 22, 2015 at 09:47:38PM -0400, John Aaron wrote:
I tried the delay (20) and got the same thing.
The 20 is tenths of a second, so the 20 is only 2 seconds.

I can't think of any other way of doing the script because it all depends on
the server how long it takes to send the information to update the page.
During heavy use times I have seen it as much as 90 seconds. I have to try
to do it with a single script because I have information saved in variables
that I use at the end to process the information collected between the
screen updates.

The only other way I can think about doing this is to use global variables,
and then use an event handler and check the status of those when the script
fires, but I am not sure if the global variables are available after the
script terminates.




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
Sent: Wednesday, April 22, 2015 9:23 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Jaws reloading after script has run too long

What happens if you use delay(20) rather than delay(20, True)? That allows
JAWS events to go through normally during the delays.

Other questions and possibilities:

How long have you ever seen that delay before the page loads? If it's
usually less than five seconds, I would recommend something more like
5 instead of 20 between polls, so the user's wait time is not extended by up
to two extra seconds.

Is it a good idea to use a scheduleFunction poll instead of a loop?
That would give JAWS back to the user while the script waits for the page
change, but I'm not sure if that's good or bad in your case. Two minutes is
a pretty long time to freeze a screen reader though. :-)

Finally, you may find that something like SayNonHighlightedText, or its
root, NewTextEvent, gets called when the page changes, with a buffer of text
you can recognize as the page change itself. If you can key off that, you
might not have to poll for this at all.

On Wed, Apr 22, 2015 at 07:40:35PM -0400, John Aaron wrote:
I am doing scripting in jaws 16, and I have written a script with a While
loop. The problem is the script could run for as much as 2 minutes without
interaction before completing, but after about 30 seconds jaws reloads, and
the script stops.
Here is a slight example of what I am doing:



Var

String oldPage,

String newPage,

Int iCounter



MoveToHeading (S_TOP, 1)

oldPage = GetLine ()

newPage = oldPage

EnterKey ()



While lastPage == newPage

;wait for new page to finish loading

Delay (20, true)

MoveToHeading (S_TOP, 1)

newPage = GetLine ()



;put in a safety net in case new page never loads

If iCounter >= 60 then

newPage = "Error"

EndIf



; increment once for every 2 seconds

iCounter = iCounter + 1



EndWhile



I think what the problem is that jaws thinks it is caught in an endless loop
and reloads after about 30 seconds. Is there anyway of overriding this?



Thanks in advance.



John



__________???

View the list's information and change your settings at
http://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
http://www.freelists.org/list/jawsscripts


__________???

View the list's information and change your settings at
http://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
http://www.freelists.org/list/jawsscripts


__________�

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

Other related posts: