ScriptTip#116:      PageNumberHasChanged Function.
Synopsis:           Notifies when page number has changed in Word 8.
Description:        Plays a wave file whenever the page number has changed
when working in Word 8.

Remarks:            Someone asked about a means of notifying the user
whenever the page number has changed, while working in Word 8, as well as
other editors.
One means of this is to have Jaws monitor the status line section that
displays the current page number.  It first requires a frame be set around
that area, then a specific function be created to give a tone whenever that
frame's contents have changed.
This particular example assumes you have a "ding.wav" file in the
C:\Windows\Media folder, but you can edit the PlaySound line to whatever
wave file you want.
These instructions are for Word 8, but can be applied in any editor with
the page number on the status line, and the status line is stationary.
This isn't the only means, but is all I can come up with on such short
notice!  As always, feedback is welcomed!

Example:            When moving through an edit session, the only means of
detecting if you've moved into another page is to constantly monitor the
status line--in particular, the Page number field.
These instructions gives Jaws that task, so you don't have to do so much
monitoring!

Compatibility:      JFW3.x or higher.

--------------------------------------------------------------------------
First thing we need to do is to set a frame around the area we want JFW to
monitor.
1)  Load Word 8, (or any other editor you want to apply this to), as for a
standard edit session.
2)  Invoke the JawsCursor with the NumPad dash and hit PageDown to get to
the Status Bar.
3)  Hit Home key and make sure you are indeed on the Page number area.  (If
not using Word 8, then move your cursor to the left edge of the area
displaying the page number.)
4)  Set the left-edge of the frame here with a press of the
Control+Insert+[ key.  Don't worry if you don't hear any feedback from that
keystroke--fixing that will come in future ScriptTip!
5)  Using your RightArrow, move to the right-edge of this page number area.
With Word 8, you should have the text "Page 1" in that area, so to get line
numbers as high as "Page 999", move your cursor to the right a couple of
more spaces.  If you hear a letter, then you've gone one character too far,
so hit the left arrow once.  Actually, since we're not setting the frame to
announce the page number, leaving the right-edge on that letter is ok, but
if you want to assign a hotkey to this frame so you can check page numbers
with a designated keystroke, you'll want to back off one character.
6)  Set the right-edge of the frame at this location by hitting the
Control+Insert+].  This will place you into the Frame Manager, in the
General properties for the newly-set frame.
7)  Give your frame a name, such as PageNumberFrame, then tab down to
"Synopsis:" and type in "Frame around page number field."
Tab down through this General area, making any changes you desire, such as
giving it a description, assigning a keystroke, etc.
8)  Control+Tab to the "Action" dialog and set the Processing Priority
to a level 1, then tab to the "New Text function field and type in
"PageNumberHasChanged".
9)  Control+Tab to the next dialog and erase any name in the "Name" field.
Tab to the "Frame must contain..." field and type in the single word
"Page", and whack Enter on Ok.

Now, we have a frame around the Page number field, and all that is left is
to create the function we want triggered when text in this frame changes!

1)  Since we are back in the editor, hit Insert+0 to launch the Script
Manager with  the editor's script file loaded.
2)  Hit Control+End to reach the bottom of the file, then whack Enter to
give yourself space to work.
3)  Type in, or cut and paste, the following function:

; Gives audible tone notification when text in PageNumberFrame has changed.
;6/29/99  Dennis Brown, [EMAIL PROTECTED]
Void Function PageNumberHasChanged ()
;Assign a short tone that is to be played when text in frame changes.
;It plays the ding.wav wave file found in my c:\windows\media folder.
PlaySound("c:\\windows\\media\\ding.wav")
;Announce a temporary confirmation message-place a semicolon at the
;beginning of that line when you've verified that the function works as
;advertised!
SayString("Page number has changed!")
EndFunction

4)  Hit Control+S to compile the new script modifications.
5)  When back in the Word 8 editor, load a multi-paged document and arrow
down through the pages, and see if your function is working properly.
Once verified, you can hit Insert+0 to launch the Script Manager again and
semicolon that SayString line within that script, so as to get the ding
noise only.
__________________________________________________________________________

Thanks,
Dennis Brown, [EMAIL PROTECTED]
Visit the Blind Programming site at http://www.mindspring.com/~brown99/



-
Visit the jfw ml web page: http://jfw.cjb.net

Reply via email to