Jacob S. writes:
I wrote the following quick PERL script that uses Applescript to speak the contents of STDIN in the UNIX shell environment. See code comments for more information. Enjoy.Read the rest of the article for the (very short) script...
Some cool uses that I use this for are:
- Use in /etc/hosts.allow to alert you when a deny is triggered
- Use to speak ipfw log contents
Copy the below text into a file called xspeak. Toss the xspeak file somewhere in your path and chmod +x it.
#!/usr/bin/perl -w
Program: xspeak v1.0 (05 Jan 2002)
# Author: jshaw at sps.lane.edu (http://www.sps.lane.edu/~jshaw)
# Platform: MacOS X 10.1.x
# Synopsis: Simple PERL script that uses Applescript to speak STDIN
# Usage: "foo | xspeak" or "xspeak < filetoread"
$|++; # Flush, just in case
while(<>) {
$args = "\'say \"$_\"\'";
system("/usr/bin/osascript -e $args");
}
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020107182354452