tell application "SpeechRecognitionServer" local theResultstring, helpLanguageModel, choicesLanguageModel set helpLanguageModel to {"help", "help me", "what can i say"} set choicesLanguageModel to {"Expose 1", "Expose 2", "Expose 3", "Expose 4", "Hack Expose", "Unhack Expose"} set thePrompt to "Choose an option [[emph +]] " try set theResultstring to listen for choicesLanguageModel & helpLanguageModel with prompt thePrompt giving up after 30 if theResultstring is "Expose 1" then tell application "System Events" to key code 111 --F12 else if theResultstring is "Expose 2" then tell application "System Events" to key code 101 --F9 else if theResultstring is "Expose 3" then tell application "System Events" to key code 109 --F10 else if theResultstring is "Expose 4" then tell application "System Events" to key code 103 --F11 else if theResultstring is "Hack Expose" then do shell script "defaults write com.apple.dock wvous-olddesktop -bool true;killall dock" else if theResultstring is "Unhack Expose" then do shell script "defaults write com.apple.dock wvous-olddesktop -bool false;killall dock" else if theResultstring is in helpLanguageModel then say "I would really like to help you but I cannot." end if end try end tell