[jawsscripts] ScheduleFunction not Working

  • From: "Dean Masters" <dwmasters@xxxxxxxxxxxxx>
  • To: "JAWS Scripts" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Wed, 4 Mar 2009 15:31:26 -0500

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

Other related posts:

  • » [jawsscripts] ScheduleFunction not Working - Dean Masters