how do you keep "listen for" from timing out?

I have this script and I want it to sit still until I hears a phrase. But, it times out if it waits too long. Is there something I can do to keep this from timing out.

tell application “SpeechRecognitionServer”
activate
set heardPhrase to listen for {“lights on”, “turn off lights”, “call josh”, “quit ichat”, “play music”, “turn music off”}
end tell

Try this script…

activate application "SpeechRecognitionServer"
set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"}

I get an error with that saying “script doesnt understand the listen message”

From the dictionary…

Speech Recognition Suite
Providing access to speech recognition via AppleScript

listen for‚v : Listen for a spoken phrase
listen for list of string : list of possible phrases to listen for
[with prompt string] : text computer will speak as a prompt
[giving up after integer] : how many seconds to wait before giving up
[filtering boolean] : whether to skip phrases with special characters
[displaying list of string] : an optional list of commands to be displayed
→ string : the recognized phrase

listen continuously for‚v : Listen for spoken phrases. Call stop listening when done.
listen continuously for list of string : list of possible phrases to listen for
[with prompt string] : text computer will speak as a prompt
[giving up after integer] : how many seconds to wait before giving up
[filtering boolean] : whether to skip phrases with special characters
[with identifier string] : a unique identifier string for this recognizer
[with section title string] : a section title under which the commands will be listed
[displaying list of string] : an optional list of commands to be displayed
[attach to psn ] : only listen for commands when this application is frontmost
→ string : the recognized phrase

stop listening for identifier‚v : Stop listening when listening continuously
stop listening for identifier string : the unqiue identifier string for the recognizer to stop

one more try…

tell application "SpeechRecognitionServer" to set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"}

oen of theses might be better…

ignoring application responses
	tell application "SpeechRecognitionServer" to set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"} to activate
end ignoring
tell application "SpeechRecognitionServer" to set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"} to activate

What are you using to write these? They don’t compile in Script Editor.

the Script Editor on Tiger (10.4.3)

no luck with these. The script I have works fine if I give it a command. But, if I wait too long, it times out. I think I need a loop that will keep it from timimg out.

what is weird…if you run this, the stop button does not work until it times itself out either. Weird…

tell application "SpeechRecognitionServer"
	activate
	set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"}
end tell