AppleScript:如何让AppleScript在按特定键时说出所选短语?

AppleScript:如何让AppleScript在按特定键时说出所选短语?,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 "" button

如何使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"
但即使是用水银,我似乎也不明白


这是一个应用程序,我的一个朋友看不到好的,所以现在我想应用程序说,哪个键被按下

以下内容应能帮助您做到这一点:


另外,由于您需要的命令是“say”,因此这里有相关文档:

Hi,谢谢,但我找不到如何将其分配给密钥。我知道如何使用“Say”命令,但不知道如何分配它。提前谢谢。没问题,看一下:没问题。如果成功了,接受答案(和/或向上投票)是表达感谢的好方法!如果你还有其他问题,请不要犹豫,让我知道。因为我的名声还不到15岁,所以我不能投赞成票,但当我达到15岁时,我一定会投你的赞成票:)