brian d foy wrote a program to make his computer talk. Here's a more efficient version using Mac::Speech (from Mac::Carbon), instead of RunAppleScript/DoAppleScript.
my $voice = $Mac::Speech::Voice{Victoria};
my $channel = NewSpeechChannel($voice);
for ( reverse ('blast off!', 1 .. 10 ) ) {
SpeakText($channel, $_);
print "$_\n";
sleep 1;
}
sleep 1 while SpeechBusy();
DisposeSpeechChannel($channel);
Now Playing: Blue Sunday - Tom Petty & The Heartbreakers (The Last DJ)