Poor-man's AppleScript vocalizer

Jun 13, '11 07:30:00AM

Contributed by: tedw

A bad cold has temporarily robbed me of my voice, so I decided to pay homage to Stephen Hawking and whip up a poor-man's vocalizer. More fun than function here, but it did let me order my latte at Starbucks without pain, and with a great many laughs all around.

Run this from the AppleScript Editor, save it to the Scripts Menu, or save it as an Application; whatever method works best for you.

property currentVoice : "Vicki"
set systemVoices to {"Agnes", "Albert", "Alex", "BadNews", "Bahh", "Bells", "Boing", "Bruce", ¬
 "Bubbles", "Cellos", "Deranged", "Fred", "GoodNews", "Hysterical", "Junior", "Kathy", ¬
 "Organ", "Princess", "Ralph", "Trinoids", "Vicki", "Victoria", "Whisper", "Zarvox"}

repeat
 activate me
 set theResult to display dialog "Say What?" default answer ¬
  "" buttons {"Quit", "Speak", "Change Voice"} ¬
  default button "Speak" cancel button "Quit"
 if button returned of theResult is "Quit" then
  exit repeat
 else if button returned of theResult is "Change Voice" then
  set currentVoice to item 1 of ¬
   (choose from list systemVoices with prompt "Choose new voice.")
 end if
 if text returned of theResult is not "" then
  say text returned of theResult using currentVoice volume 1
 end if
end repeat

[crarko adds: I tested this, and it works as described. I thinks it's a simple and clever usage of a well-known Mac feature.]

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20110609212028767