Question about Speech Recognition Server

Anybody know why “listen” works, yet “listen continuously” does not?

specifically, I wrote this script that works like a champ if you remove the word “continuously” (and comment out the remainder of that line, starting at “attach”:

on run {myCommands}
local theResultstring, wordCount, x, WordList, myCommands
set theResultstring to “No Command”
set WordList to (every word of myCommands) as list
tell application “SpeechRecognitionServer”
try
set theResultstring to listen continuously for WordList attach to SpeechRecogRB with identifier MyStdIdentifier
end try
end tell
set wordCount to number of items in WordList
repeat with x from 1 to wordCount
if theResultstring = item x of WordList then
return item x of WordList as string
end if
end repeat
return “Unknown response”
end run

Hi,

Use "listen continuously for’ has more parameters. You need the identifier for the ‘stop listening for identifier’ command. Something like this:

tell application “SpeechRecognitionServer”
listen continuously for {“hello”, “goodbye”} with identifier “greetings”
set the_phrase to result
if the_phrase is “hello” then
stop listening for identifier “greetings”
say “hello, what do you want to do?”
listen continuously for {“make a note”, “quit this”} with identifier “do something”
set the_phrase to result
stop listening for identifier “do something”
– make a note or quit
if the_phrase is “quit this” then
beep 3
quit
end if
else
quit
end if
end tell

gl,

You have no idea how grateful I am. Thank you. I’ve been beating my head on this for more than a week!!!