Reputation: 31
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.
Upvotes: 2
Views: 1727
Reputation: 9910
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
Upvotes: 1