[jawsscripts] ReadContinuously

  • From: "Dean Masters" <dwmasters@xxxxxxxxxxxxx>
  • To: "JAWS Scripts" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Wed, 29 Apr 2009 16:48:00 -0400

Here is what I have now. For those who have not been following this, I am 
trying to write a script to read the text in a bible program continuously. 
So it would read the first screen then move to the next screen. I have 
schemes set up in the program so when studying you can hear where items you 
can click on are. I want these turned off when reading continuously. right 
now the scheme is changed to classic which means no sounds for the first 
page. Then when it goes to the second page I hear the sounds. then on the 
pages after that there are no sounds. This would not be too bad depending on 
what you were listening to. Some books have a lot of superscripts and 
Scripture references which can be clicked on.



I am also trying to get it to stop reading when hitting a keystroke. I tried 
to stop the scheduled function in the TopOfText function but this does not 
stop the scheduled function.



I thank everyone for the suggestions given so far.



Void Function PositionForNextRead ()

InvisibleCursor ()

JAWSPageDown ()

If GetLine () == CurrentLine then;bottom line has not changed so it at end 
of book

Return

ElIf FindString (GetFocus (), CurrentLine, s_bottom, s_restricted) then

NextLine ();so line won't be repeated

Else

JAWSPageUp ()

JAWSHome ()

EndIf

RefreshWindow (GetCurrentWindow ())

TopOfText ()

EndFunction

Void Function TopOfText ()

VAR

string LastLine,

Int iKeyWasPressed, ;use this to terminate the while loop.

string sScheme,

string sScheme1,

string sScheme2

Let iKeyWasPressed = IsKeyWaiting () ; set variable to true if a key was 
pressed.

LET Global_ScheduleIdentifier = scheduleFunction ("PositionForNextRead", 
200)

;If iKeyWasPressed then

; Return ; get out before starting process and while loop

;EndIf

InvisibleCursor ()

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 ==0 then

SayLine ()

Let LastLine = CurrentLine; sets up for new comparison

NextLine ();scrolls down one line

Let CurrentLine = GetLine (); saves the new line

EndIf

EndWhile;loop until the two lines are the same

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

PCCursor ()

TypeKey ("spacebar");new keystroke in Libronix 3c to go to next screen

Say ("next page", ot_status, false); for texting

scheduleFunction ("PositionForNextRead", 200)

If iKeyWasPressed then

UnScheduleFunction (Global_ScheduleIdentifier)

EndIf

EndFunction

Script ReadContinuously ()

VAR

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

InvisibleCursor ()

RouteInvisibleToJAWS ()

SetRestriction (restrictWindow)

RefreshWindow (GetCurrentWindow ())

Pause ()

TopOfText ();speaks screen of text then scrolls to the next page

SwitchToScheme (sScheme2) ;Switches back from classic to LDLS scheme

Let g_ChapterAndVerseToggle = 1;turns on speaking of chapter and verse

EndScript



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] ReadContinuously - Dean Masters