如何获得AppleScript的对我说什么回应? [英] How do I get applescript to respond to what I say?

查看:245
本文介绍了如何获得AppleScript的对我说什么回应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我非常新的AppleScript,但我工作的一件大事。我看着一吨的其他论坛,但我没能找到正是我一直在寻找。我试图制造类似贾维斯在我的iMac铁人三项影片中出现。我有一些事情,我需要到目前为止知道了。第一件事是最重要的。我想这样说,我回来了,并贾维斯将响应,欢迎回来,先生。另一件事,我说,唤醒和贾维斯使得屏幕或任何的计算机GET(可通过晃动鼠标或pressing一键完成),但贾维斯确实对我来说。最简单的一个,我需要的只是怎么说的东西,然后有响应。此外,也许,如果我说这句话,你好贾维斯,并回应你好,先生,你今天好吗?也许它有多个答案一样,如果我说,好,它回答很好听的说:如果我回应,坏它说,像好感觉好多了。

So, I am very new to AppleScript but i'm working on something big. I looked at a ton of other forums but I was not able to find exactly what I was looking for. I am trying to make something like Jarvis as seen in IronMan movies for my iMac. I have a few things I need to know so far. The first thing is the most important. I want to say something like, "Im back" and Jarvis will respond with, "Welcome back sir." Another thing, I say, "Wake up" and Jarvis makes the computer get of the screensaver or whatever (Can be done by wiggling the mouse or pressing a key) but Jarvis does it for me. The most simple one that I need is just how to say something and then it responds. Also, maybe if I say to it, "Hello Jarvis" and it responds "Hello sir. How are you today?" and maybe it has multiple answers like if i say, "Good" it responds "Good to hear that" and if I respond, "Bad" it says something like "Well feel better."

是否有一个脚本的东西对于这一点,

Is there a script for something for this,

我说,醒醒,或我回来了,并将其与响应:先生您好,欢迎回来,刚才你(编号错过Skype的消息或未接来电和(数字错过了电子邮件)错过了电​​子邮件。你想打开的Skype或邮件?
然后,如果我说是的,它会打开邮件和Skype。

I say, "Wake up" or, "Im back" and it responds with, "Hello sir. Welcome back, you have (Number of missed Skype messages or missed calls" and (number of missed emails) missed emails. Would you like to open Skype or Mail?" And then if I say yes it opens mail and Skype.

可能是很多要求,但我希望有人能够帮助这一点。谢谢!

Might be a lot to ask for but I am hoping someone can help with this. Thanks!

推荐答案

您可以使用口述项目。

下面是一个古老的暗示我贴在 MacosxHints 。 (2006年),它和其他的例子可以在那里找到。
我只是测试它,它仍然有效。

Here is an old hint I posted on MacosxHints. (2006) It and other examples can be found there. I Just tested it and it Still works.

在一个新的脚本编辑器文件复制此code
点击编译按钮(锤子的形象)。
保存为一个脚本Givinn它取名为您好
把它放进的〜/资源库/语音/可口述项目

Copy this code in to a New 'Script Editor' Document Click the compile button (image of a hammer). Save as a Script Givinn it the Name "Hello" Put it into ~/Library/Speech/Speakable Items

on run
    try
        tell application "System Events"
            set full_name to full name of current user as string
            set first_name to first word of full_name as string
        end tell
        say "Hello " & first_name & ", hey,   whats up?"
    end try
end run

现在,当你说你好,就会回复您好你的名字,哎,怎么了

Now when you say Hello, it will reply "Hello 'Your first name' , hey, Whats up"

文件名是什么应用程序正在侦听。

The file name is what the Application is Listening for.

口述项目在系统preferences控制的'无障碍'prefpane下。

Speakable items is controlled in the System preferences under the 'Accessibility' Prefpane.

这篇关于如何获得AppleScript的对我说什么回应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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