[jawsscripts] repost of dean's problem re ScheduleFunction not Working

  • From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sun, 8 Mar 2009 17:37:48 +1100

Hi list, I thought I'd just rePost Dean's issue since I hadn't seen any
responses to it yet, and hoped that a reminder might help if anyone has time
to take a look?

I'm just soooo not up to speed with while loops and how they're most
effectively used dean, that I'm afraid I feel I'm personally unable to
usefully comment on how it might interact with trying to schedule a
function, the only brief half-thoughts I had about your code below, were:
that I kinda thought we'd come to the conclusion generally from other's
responses too, that trying to utilize scheduleFunction with a set time
period, for this sayAll type replication,
could probably not really work in any way effectively,
for the very reason you indicated below.
that I couldn't see how it couldn't result in "blank time," as you put it,
dependent on user's sayAll speed etc, and so a more sophisticated or
alternate approach to handle the actual problem would be required. Perhaps
restating/reposting the problem you are actually confronting, might help
someone to come up with an alternate suggestion for handling it though, if
what I suspect, is truely the case?

if I understand it right, you've got an application that can't be made in
and of itself to perform any kind of SayAll without user intervention,
right? and your trying to make it do this screen by screen, artificially
with scripts. is this correct?

From: "Dean Masters" <dwmasters@xxxxxxxxxxxxx>
To: "JAWS Scripts" <jawsscripts@xxxxxxxxxxxxx>
Sent: Thursday, March 05, 2009 7:31 AM
Subject: [jawsscripts] ScheduleFunction not Working


> I thought putting the TopOfText function as a scheduled function would
slow
> the ReadContinuously script down. Instead, it doesn't run. I hear it read
> the first page then say it is going to the next page. It says it is saving
> the current page. It does not read the page but says "got next current
page"
> meaning it expects the TopOfText function to have run. I then usually hear
> that phrase again. Then year "that's all folks" meaning the last page and
> current page are the same. When I check the page I see that it has
actually
> gone to the third page but only the first page has been read. It reads no
> more.
>
> Do I have the ScheduleFunction written correctly? Any other suggestions?
> Someone suggested using the ScheduleFunction but didn't suggest how and I
am
> just trying to guess where it might help slow things down without making
for
> blank time depending on different speeds for different users.
>
> Void Function TopOfText ()
>
> VAR
>
> String CurrentLine,
>
> string LastLine,
>
> Int iKeyWasPressed ;use this to terminate the while loop.
>
> JAWSCursor ()
>
> Let LastLine = GetLine (); saves first line
>
> SayLine ();speaks first line
>
> JAWSHome ()
>
> NextLine ();scrols to next line
>
> Pause ()
>
> Let CurrentLine = GetLine ();saves new line
>
> While (CurrentLine != LastLine && iKeyWasPressed ==0);speak if two
> adjacentlines are dissimilar or if a key was pressed
>
> Let iKeyWasPressed = IsKeyWaiting () ; set variable to true if a key was
> pressed.
>
> If iKeyWasPressed then
>
> Return
>
> Else
>
> SayLine ()
>
> Let LastLine = CurrentLine; sets up for new comparison
>
> JAWSHome ()
>
> NextLine ();scrolls down one line
>
> Let CurrentLine = GetLine (); saves the new line
>
> EndIf
>
> EndWhile;loop until the two lines are the same
>
> If iKeyWasPressed then
>
> Return
>
> Else
>
> PCCursor ()
>
> TypeKey ("spacebar");new keystroke in Libronix 3c to go to next screen
>
> Delay (3, false)
>
> Say ("next page", ot_status, false); for testing purposes
>
> JAWSCursor ()
>
> If FindString (GetFocus (), CurrentLine, s_bottom, s_restricted) then
>
> JAWSCursor ()
>
> NextLine ()
>
> Else
>
> JAWSPageUp ()
>
> JAWSHome ()
>
> EndIf
>
> EndIf
>
> RefreshWindow (GetCurrentWindow ())
>
> EndFunction
>
> Script ReadContinuously ()
>
> VAR
>
> string CurrentPage,
>
> string LastPage,
>
> string sScheme,
>
> string sScheme1,
>
> string sScheme2
>
> Let sScheme = GetCurrentSchemeName ();scheme set for sounds which is to be
> turned off for this script
>
> If GetCurrentSchemeName () != "LDLS" then
>
> Let sScheme1 = sScheme
>
> Let sScheme2 = sScheme
>
> Else
>
> Let sScheme1 = "Classic"
>
> Let sScheme2 = "LDLS"
>
> EndIf
>
> Let g_ChapterAndVerseToggle = 0;mutes speaking of the chapter and verse
>
> SwitchToScheme (sScheme1);switches to the classic scheme if in LDLS scheme
>
> PCToText ();function I wrote to make sure the PC and JAWS cursors start
out
> in the text area
>
> JAWSCursor ()
>
> RefreshWindow (GetCurrentWindow ())
>
> Pause ()
>
> Let LastPage = GetWindowText (GetFocus (), false);saves Current page
>
> Say ("Got last page", ot_status, false)
>
> TopOfText ();speaks screen of text then scrolls to the next page
>
> Let CurrentPage = GetWindowText (GetFocus (), false);saves new page
>
> Say ("got current page", ot_status, false)
>
> While (CurrentPage != LastPage) ;speak if two concurrent pages are
> dissimilar
>
> Let LastPage = CurrentPage;sets up comparison
>
> ;TopOfText ()
>
> ScheduleFunction ("TopOfText", 20)
>
> ;Pause ()
>
> Let CurrentPage = GetWindowText (GetFocus (), false);saves new page
>
> Say ("got next current page", ot_status, false)
>
> EndWhile;loop until the two pages are the same
>
> Say ("That's all folks!", ot_status, false);for testing purposes
>
> SwitchToScheme (sScheme2) ;Switches back from classic to LDLS scheme
>
> Let g_ChapterAndVerseToggle = 1;turns on speaking of chapter and verse
>
> EndScript
>
>
> thanks,
> Dean
>
>
> __________
> 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

Other related posts: