如何使用AppleScript语音识别来听取任何单词?

时间:2011-10-06 13:44:52

标签: applescript voice-recognition

我如何才能使用AppleScript语音识别来听取任何单词?这就是我到目前为止所做的:

tell application "System Events"
    keystroke "c" using {command down}
end tell

tell application "iCal" to activate

tell application "System Events"
        keystroke "n" using {command down}
    keystroke "v" using {command down}
    keystroke return
end tell

我想用第一行的副本替换任何单词。

1 个答案:

答案 0 :(得分:3)

tell application "SpeechRecognitionServer"
    set answer to listen for {"yes", "no"} with prompt "prompt"
    --hold the listening key (by default escape) to record an answer
end tell

必须首先启用可说话的项目:

有关详细说明,请参阅http://macscripter.net/viewtopic.php?id=24662