2011-10-06 45 views
1

我怎樣才能讓applescript語音識別監聽任何單詞?這是我到目前爲止:我怎樣才能讓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 

我想在第一行替換副本來聽任何單詞。

+0

我看不出你的AppleScript與語音識別有什麼關係。 –

回答

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更詳細的說明。