This script is useful for replacing Mail.app's very, very lame signatures function. I keep it compiled as an application in the Finder's Script Menu.
I used fortune with a handey flag, which is just a collection of Jack Handey funnies I collected from the Quote Cache and converted to fortune file format (Unix text file and .dat file). This is really the handiest way to make a file of your own signatures. Otherwise, if calling fortune with no flags, you could end up with some strange sigs. For instructions on making your own fortune files, see man fortune and man strfile (Handey fans can email me for a copy of the Handey fortunes file).
Read the rest of the article for the script...
Feel free to distribute with attributions intact. This script is email-where, as in email me and tell me where you're at. I collect country .suffixes. Have fun!
I used "Crazy Message Text" script as the basis for the Mail.app portion of the script, eliminated an error in that script which overwrote an existing message in Mail with contents of the result (used count function to set the result to the new message instead of the first).
Here's the script:
set textResult to do shell script "/sw/bin/fortune handey"[Editor's note: I haven't tried this myself yet, but I plan to!]
(* Change the fortune flag to your own fortune file or a favorite,
like humorists or zippy.
set theSig to "
Tony O tonyo at mac daht com
" & textResult
(* Put your own address in here.
tell application "Mail"
set newMessage to make new compose message at end of every compose message
set the content to theSig
make new message editor at beginning of message editors
set countMessage to count of message editor
set content of newMessage to the content of newMessage
set compose message of message editor countMessage to newMessage
Mac OS X Hints