Return to Script Index

Description

Here's a starter script that when registered and run from ConnectedText's "Scripts" menu will read the currently-displayed topic page aloud.

Requirements 

This script was tested under ConnectedText 2.0.0.2 on Windows XP SP2 with Python 2.4 and the associated Win32 extensions (currently recommended for use with CT -- see CT documentation for details).  Additionally, you'll need to install:

Fortunately, all of the above items come with installers so getting set up is trivial.

Installation

Download this script and place it in your /ConnectedText/Scripts folder.  Register it with the "Manage Scripts..." function under ConnectedText's "Scripts" menu option.  Once it is installed, navigate to any topic (page) within your wiki project and select the script from the menu.  You should hear the page text read aloud.

Notes

I've tried to comment the source code adequately so you can figure out what I'm doing.  The script is more verbose than it needs to be, but I left it that way for clarity.  Much of the heavy lifting is performed by Regular Expressions, and I'm sure there are some RE gurus out there horrified by my clumsy work -- suggested improvements are welcome. 

Enhancements, Suggestions, Etc.

I tested this script against quite a few of the pages in the "Welcome" documentation that comes with ConnectedText, but it is far from perfect.  For instance, when a table is encountered the script will announce "begin table" and "end table" appropriately if the {| and |} markup is used.  Otherwise, the contents of the cells will be read verbatim and without viewing the page the listener might not be aware that the information is contained in such a structure.  One enhancement would be to read the column names and announce when a new row is being read.

Images are another area where the script can be improved; instead of just announcing "image" when one is encountered, it would be useful to read the image's caption if it exists.

The module that allows Python to interact with the Microsoft Speech API (SAPI) is PyTTS, written by Peter Parente.  You can find his PyTTS tutorial here, which will be invaluable if you're planning on modifying this script for your own use.  You'll note that there's quite a bit more to this library than what is utilized in my script. 

Return to Script Index