如何在按特定键时让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,我也无法弄明白。
这是我的朋友的应用程序,看不到好,所以现在我希望应用程序说出按下了哪个键。
答案 0 :(得分:1)
以下内容可帮助您完成此操作:https://discussions.apple.com/thread/665313?start=0&tstart=0
此外,由于你想要的命令是“说”,这里是它的文档:http://docs.info.apple.com/article.html?path=AppleScript/2.1/en/as304.html