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


Click here to return to the 'A real random fortune signature for Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A real random fortune signature for Mail.app
Authored by: dushu on Jan 30, '11 10:05:50PM

I've been using this hint for quite some time with a small twist, however after updating to 10.6.6, the following problem has starting occurring intermittently:

Fortune gets stuck in a loop and starts using 90-100% of CPU.

My setup is as follows:

1. Fortune downloaded from http://www.thinkyhead.com/fortune (the other links on this page are no longer working including cocoa fortune) and compiled using xtools
2. Rule setup in mail.app to run the random signature script whenever an email comes to a specified mail address
3. Random signature script as follows:
_________________________________
set fortune to do shell script "/usr/bin/fortune"
set sigg to "Dushyant Ahuja
" & fortune
tell application "GrowlHelperApp"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to
{"Signature"}
set the enabledNotificationsList to
{"Signature"}
register as application
"Random Sig" all notifications allNotificationsList
default notifications enabledNotificationsList
icon of application "Script Editor"

notify with name
"Signature" title
"Mail Signature" description
sigg application name "Random Sig"

end tell
tell application "Mail"
set content of signature 1 to sigg
end tell
______________________________________
I even tried to change the script to kill fortune after 1 sec - however no result:
-----------------
set fortune to do shell script "/usr/bin/fortune&"
set sigg to "Dushyant Ahuja
" & fortune
delay 1
try
do shell script "killall fortune"
end try
tell application "GrowlHelperApp"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to
{"Signature"}
set the enabledNotificationsList to
{"Signature"}
register as application
"Random Sig" all notifications allNotificationsList
default notifications enabledNotificationsList
icon of application "Script Editor"

notify with name
"Signature" title
"Mail Signature" description
sigg application name "Random Sig"

end tell
tell application "Mail"
set content of signature 1 to sigg
end tell
------------------
Would appreciate if someone can help



[ Reply to This | # ]
A real random fortune signature for Mail.app
Authored by: dushu on Feb 02, '11 01:07:08PM

Finally resorted to installing macports to install fortune - this version seems to be compiled for Intel whereas the earlier one was compiled for PPC;
No problems till now - fingers crossed.



[ Reply to This | # ]