Skip to content

Instantly share code, notes, and snippets.

@kristopherjohnson
Created November 14, 2019 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristopherjohnson/3f0a85513e839b89f68960256df5a171 to your computer and use it in GitHub Desktop.
Save kristopherjohnson/3f0a85513e839b89f68960256df5a171 to your computer and use it in GitHub Desktop.
Friendly AppleScript
tell application "SpeechRecognitionServer"
set possibleResponses to {¬
"hello", ¬
"good bye", ¬
"good morning", ¬
"good afternoon", ¬
"good night", ¬
"nice to meet you", ¬
"pleased to meet you", ¬
"how are you", ¬
"hi", ¬
"hey", ¬
"how's it going", ¬
"yo", ¬
"good evening", ¬
"quit"}
repeat
set theResponse to (listen for possibleResponses with prompt "Hello")
if theResponse is "good bye" or theResponse is "quit" then
exit repeat
end if
say theResponse & "?"
end repeat
say "Good bye."
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment