我怎样才能让AppleScript的语音识别听任何一句话? [英] How can I make applescript voice recognition listen for any word?

查看:636
本文介绍了我怎样才能让AppleScript的语音识别听任何一句话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能让AppleScript的语音识别听任何一句话?这是我到目前为止有:

 告诉应用程序系统事件
    按键C使用{命令下来}
告诉结束告诉应用程序的iCal来激活告诉应用程序系统事件
        按键N使用{命令下来}
    按键V使用{命令下来}
    击键回
告诉结束

我想代替在第一行的副本听什么话。


解决方案

 告诉应用程序SpeechRecognitionServer
    答案设置为监听{是,否}与提示提示
    --hold听音键(默认情况下逃生)来记录一​​个答案
告诉结束

口述项目都必须先使能:


请参阅 http://macscripter.net/viewtopic.php?id=24662 更详细的说明。

How can I make applescript voice recognition listen for any word? This is what I have so far:

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

I would like to substitute the copy on the first line to listen for any words.

解决方案

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

Speakable items have to be enabled first:

See http://macscripter.net/viewtopic.php?id=24662 for more detailed instructions.

这篇关于我怎样才能让AppleScript的语音识别听任何一句话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆