Hi David,
 
your idea is correct, but you've got the wrong event of the speech object.
There are actually 9 of these events, each one representing a different type
of processing which can be done on the string about to be spoken.
 
These events aren't documented well in my opinion (there's very little
explanation as to what exactly each one does).  There's also little
explanation which explains that if you want to intercept speech and do
processing on it, you'll need to figure out which kind of processing you are
doing (type being compared to the type of processing represented by these 9
different events).
 
Since you are wanting to do something based on a single character which is
not alpha-numeric, you'll need to use the OnProcessCharacterDictionaries
event, in order to be able to see the string about to be spoken, before the
punctuation is replaced by text strings.
 
Just change events and I think it will work for you.
 
hth,
 
Chip
 
 

  _____  

From: David [mailto:[email protected]] 
Sent: Saturday, August 20, 2011 6:19 PM
To: [email protected]
Subject: Guess I am on the wrong Event?


Hi scripters,
I am trying to make an app that handles fractional numbers. That is, have it
speak the word "Fractional", when it reaches numbers like 1/4. Below is a
snip of my code. My thought was to connect to the Speech/OnSpeak event, and
simply check if there is a SLASH in the original string. But that seems not
to work. When things like 1/2, 2/3 or 3/4 occurs, it seems that the OnSpeak
string is broken into two seperate strings, by Window-Eyes. Not sure why GW
would do such a thing, but that seems to be the case. In other words, the
1/3, will be broken into two strings: "1", and "3". This causes, far as I
can see, Window-Eyes not to ever 'see' the slash inbetween; hence my code
never works.
 
Am I connecting to the wrong event? Is there a better approach to the
matter?
 
---Snip of code---
ConnectEvent Speech, "OnSpeak", "MOnSpeak"
 
Function MOnSpeak( OriginalString )
 If InStr(OriginalString, "4") Then OriginalString = "Fractional, " &
OriginalString
 MOnSpeak = OriginalString
End Function 'MOnSpeak.
----End of snip----
Speak "Fractional, is running."

Reply via email to