[jawsscripts] Re: ScheduleFunction
- From: "Cohn, Jonathan C [IT]" <Jonathan.C.Cohn@xxxxxxxxxx>
- To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
- Date: Wed, 25 Feb 2009 21:35:14 -0600
The schedule function has the advantages:
1. It allows jaws to go off and do something else while waiting.
2. It can be disabled i.e. there is a unscheduled function.
The disadvantage is that you need a separate script, and you need to consider
what happens if focus changes. So for example watching for a focus change away
from your active window and then calling the unscheduled.
The Communicator and Messenger scripts use the schedule function to check the
status line for "is typing a message" or "is writing a message" and then
produce ticking sounds and let you know that the other party is active.
Best,
Jon
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Dean Masters
Sent: Wednesday, February 25, 2009 9:39 PM
To: JAWS Scripts
Subject: [jawsscripts] ScheduleFunction
How is the ScheduleFunction used? If it is only to let a function be run after
a certain time why not just put a delay then the function?
The following is to read a screen of text then go to the next screen and
continue reding until the end of the text or until a key is pressed. It will
read but then skip a page or two before reading again. someone suggested the
ScheduleFunctionn might help here. Any suggestions how?
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
; Pause ()
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
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
TopOfText ();speaks screen of text then scrolls to the next page
Let CurrentPage = GetWindowText (GetFocus (), false);saves new page
While (CurrentPage != LastPage) ;speak if two concurrent pages are dissimilar
Let LastPage = CurrentPage;sets up comparison
TopOfText ()
Pause ()
Let CurrentPage = GetWindowText (GetFocus (), false);saves new page
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
This e-mail may contain Sprint Nextel Company proprietary information intended
for the sole use of the recipient(s). Any use by others is prohibited. If you
are not the intended recipient, please contact the sender and delete all copies
of the message.
__________
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: