Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Append a new random quote to the end of a Mail signature Apps
Here's an AppleScript that will append a new random quote from a text file to some or all of your Mail.app signatures every minute, using crontab. I've included somewhat detailed instructions on how to set the whole thing up.

First put your favorite quotes in a MacRoman encoded text file (most modern editors use UTF8 as the default, so be sure to specify MacRoman instead) somewhere on your hard drive. The quotes should be separated from each other by one empty line. Here's a sample file:
«In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.»
(Douglas Adams)

«Nothing travels faster than the speed of light, with the possible exception of bad news, which obeys its own set of laws.»
(Douglas Adams)

«A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.»
(Douglas Adams)
Next, in Mail.app, create one or more signatures to use as templates. These are the signatures that are going to have the quotes appended to them. Then create the actual signatures and associate them to your accounts. Don't bother putting anything in the actual signatures, as the script is going to overwrite them.

Open AppleScript Editor, and copy/paste the following code into it. Change the name of the file and the name of the signatures to match your own configuration:
if application "Mail" is running then
  set AppleScript's text item delimiters to "\n\n"
  set myQuote to some text item of (read "/Users/xxxxxx/Documents/Quotes.txt")
  tell application "Mail"
    set the content of signature "Personal" to the content of signature "TemplatePerso" & myQuote
    set the content of signature "Professional" to the content of signature "TemplatePro" & myQuote
  end tell
end if
Save this as an Application somewhere on your hard drive. Finally, have cron execute the script every minute using osascript. You can do that either by using a GUI application like CronniX, or by typing crontab -e in a Terminal window. Here is what the crontab line should look like:

* * * * * osascript ~/Applications/Randomize\ Signature.app >/dev/null 2>&1

Enjoy!

[robg adds: Previous random signature hints for Mail: via Fink's fortune, pulled from the internet, and a simple one-account version. I have not tested any of these.]
    •    
  • Currently 2.60 / 5
  You rated: 1 / 5 (10 votes cast)
 
[9,050 views]  

Append a new random quote to the end of a Mail signature | 11 comments | Create New Account
Click here to return to the 'Append a new random quote to the end of a Mail signature' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Append a new random quote to the end of a Mail signature
Authored by: michelle_eris on Apr 14, '10 07:49:30AM

I seem to be missing something here. mail.app already allows you to have a random signature chosen from its signature file.



[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: robleach on Apr 14, '10 08:12:50AM

Yeah. What gives? What functionality does this add that Mail doesn't already do? Did 10.6 remove the ability to use a random signature?



[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: ptatters on Apr 14, '10 09:08:47AM

If you have a standard signature block which you use with every quote, this allow you to enter the standard block once and the script combines it with the quote automagically. Disadvantage is that if the generated quote is inappropriate for the specific message content you can't then manually select another more apposite quote.



[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: skoot on Apr 26, '10 07:45:53AM

Actually you can, by running the applescript manually. Just spotlight it and hit enter.



[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: A1278 on Apr 14, '10 08:46:01PM

the feature you are referring to being built in is one that merely randomizes the sigs you have added to your sig manager.

This will obtain and randomly install a NEW sig every 1 minute so that when you start a new message, it will include the quote of the minute.




[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: TigerKR on Apr 14, '10 10:40:16PM

I think this approach can allow you to download a text file of thousands of quotes, and then be able to use those thousands of quotes in signatures. If I'm not mistaken, to replicate this without a script, you'd have to hand create thousands of signatures in Mail.app's preferences. This approach from the OP would make using a large number of signatures easier.



[ Reply to This | # ]
Er, why?
Authored by: gidds on Apr 14, '10 08:38:52AM

I appreciate the ingenuity of this hint, but don't we have enough crud at the bottom of emails already?

What with corporate disclaimers, ISP ads, full contact details, and everything else -- all repeated each time the mail gets forwarded -- the ratio of content to boiler-plate gets ever smaller. Why add yet another line that no-one will read?

---
Andy/



[ Reply to This | # ]
Er, why?
Authored by: A1278 on Apr 14, '10 08:43:41PM

IMHO You sir need more soft furry kittens around you. This is for the person that likes to add a little personality to his or her emails.

If you don;t like it, dont do it.


just sayin



[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: sdimbert on Apr 14, '10 09:10:00AM

Another, easier solution is to use this application: http://www.littleknownsoftware.com/sigpro/#

It's called Signature Proflier, and it's designed to solve this problem.



[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: skoot on Apr 26, '10 07:42:00AM

I'm the OP. This is all tested, since it's the setup I'm using.

I've used Signature Profiler for years before OS 10.6, but it doesn't work at all with exchange accounts, and with regular IMAP or POP accounts it introduces a pretty huge memory leak : Mail.app was using half a Go of RAM after a couple hours, and at the end of the day the swap file was so big that the computer had a hard time doing anything.

In a word, it's broken and hardly maintained.

As some of you have said, this rather complex hint is either for people that like to maintain a list of their favorite quotes in an external file, or that have a huge list of quotes : I have 3 email accounts and about a hundred quotes, and I don't want to create 300 signatures in Mail.app. Using this hint, I just need 3 "templates" in Mail.app and an easy to edit text file. And whenever I need to change something in the signature of one of my accounts, I don't have to edit 100 sigs by hand...

Finally, all my quotes are RFC 1855 compliant : less than 4 lines total (template + quote) and less than 80 characters wide, plain text of course. :-)



[ Reply to This | # ]
Append a new random quote to the end of a Mail signature
Authored by: ArizonaBill on Apr 27, '10 08:18:08PM

I had a similar experience. I had a list of taglines from my past I wanted to use. I ended up copying the whole list and pasting it into Mail as ONE signature that I named "tags." When I want to use one of the taglines, I select the tags signature from the list and the whole dang list pops into my message at the end. Then, I hold down the down-arrow key for a random length of time (sometimes I cheat and pick one that goes well with my message), copy the line I'm on, undo the insertion of the "tags" signature and then paste the random tag into the bottom of my message. {( ` ;

Kinda kludgy, but I've been using it since maybe 10.3. It does save having the daunting task of putting the individual taglines into signature list.



[ Reply to This | # ]