AppleScript:如何让 AppleScript 在按下特定键时说出选定的短语?
如何让 AppleScript 在按下特定键时说出选定的短语?
例如,如果按下“S”键,我希望在您键入时发生同样的事情: 说“s”
这是我现在的代码:
property this_text : "EMail"
tell application "Mail"
activate
say "loading complete, type your mail message now"
display dialog "Type your Email message." default answer "" buttons {"Cancel", "Continue"} default button 2
set the this_text to text returned of the result
set this_message to make new outgoing message at end of outgoing messages with properties {content:this_text, visible:true}
tell this_message
make new to recipient at end of to recipients with properties {address:""}
say "to who do you want to send this mail?"
end tell
end tell
say "don't forget to add an subject"
但即使使用 QuickSilver 我似乎也无法弄清楚。
这是我的一个朋友的应用程序,它看起来不太好,所以现在我希望应用程序说出按下了哪个键。
How do i make AppleScript say a selected phrase when pressing a specific key?
For example, if the key " S " is pressed i want the same thing to happen when you type :
Say "s"
This is my code for now :
property this_text : "EMail"
tell application "Mail"
activate
say "loading complete, type your mail message now"
display dialog "Type your Email message." default answer "" buttons {"Cancel", "Continue"} default button 2
set the this_text to text returned of the result
set this_message to make new outgoing message at end of outgoing messages with properties {content:this_text, visible:true}
tell this_message
make new to recipient at end of to recipients with properties {address:""}
say "to who do you want to send this mail?"
end tell
end tell
say "don't forget to add an subject"
But even with QuickSilver i can't seem to figure it out.
It is an Application for an Friend of mine which can't see good, so now i want the Application to say which key is pressed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下内容应该可以帮助您做到这一点:https://discussions.apple。 com/thread/665313?start=0&tstart=0
另外,由于您想要的命令是“say”,因此这里是它的文档:http://docs.info.apple.com/article .html?path=AppleScript/2.1/en/as304.html
The following should help you to do this: https://discussions.apple.com/thread/665313?start=0&tstart=0
Also, as the command you want is 'say', here's the documentation for it: http://docs.info.apple.com/article.html?path=AppleScript/2.1/en/as304.html