我实际上有这个脚本工作,(对于我是一个完整的初学者来说是一个惊喜)但我只是想确保这个脚本没有任何我不需要的多余代码。或者,如果有更好的方法来做到这一点,请发表评论!我最终试图创建一系列语音命令。
tell application "SpeechRecognitionServer"
set l1 to {"yes", "sure", "yes please", "open mail"}
set l2 to {"no", "no thanks", "not now"}
set no_answer to {"no", "no thanks", "not now"}
set answer to listen for l1 & l2 with prompt "Would you like me to open your email"
l1 contains answer
l2 contains no_answer
end tell
if l1 contains answer then
say "yes answer"
else if l2 contains no_answer then
say "no answer"
end if
end
提前致谢!