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

A GrowlMail alternative Apps
I really like GrowlMail but it isn't up-to-date with OS X. So here's an AppleScript alternative.

You need the growlnotify utility that comes in Growl Extras on the Growl installer disk image.

Create the following AppleScript and save it. Then create a match-all rule in Mail.app (Mail » Preferences » Rules » Add Rule) to run the script as the performed action. Don't apply it to the existing messages, just new ones.
using terms from application "Mail"
 on perform mail action with messages theMessages for rule theRule
  tell application "Mail"
   repeat with m in theMessages
    set sub to m's subject
    set sndr to m's sender
    set msg to sndr & " " & sub
    -- display dialog msg
    do shell script "/usr/local/bin/growlnotify -I /Applications/Mail.app -m " & quoted form of msg
   end repeat
  end tell
 end perform mail action with messages
end using terms from


[crarko adds: I tested this, and it works as described. There was a previous hint about making GrowlMail work with the current version of the OS, but this is a pretty good alternative too. When I created my test rule for this I just used 'if any recipient contains .com' as the matching criterion, since that matched all my accounts. But you can obviously customize the mail rule as much as you want.]
    •    
  • Currently 3.75 / 5
  You rated: 5 / 5 (4 votes cast)
 
[15,172 views]  

A GrowlMail alternative | 11 comments | Create New Account
Click here to return to the 'A GrowlMail alternative' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A GrowlMail alternative
Authored by: wheeles on Dec 07, '10 07:44:35AM
An alternative mail notification plugin is Herald.
Edited on Dec 07, '10 07:46:58AM by wheeles


[ Reply to This | # ]
A GrowlMail alternative
Authored by: asmeurer on Dec 07, '10 09:24:11AM

I've been using Mail.appetizer for some time. I might check out this Herald thing, though. It looks like it should be better.



[ Reply to This | # ]
A GrowlMail alternative
Authored by: asmeurer on Dec 07, '10 12:55:16PM

Well, Herald does have a nicer interface than Mail.appetizer, and a few extra features (like scrolling), so I think I will dump Mail.appetizer for it, but unfortunately it still has the same annoying bug as Mail.appetizer, which is that quoted text doesn't appear as such, making it hard to find the actual new parts of a conversation.



[ Reply to This | # ]
A GrowlMail alternative
Authored by: Frig on Dec 07, '10 10:46:13AM

I've extended the Applescript to use the native Applescript Interface of GrowlHelperApp to display notifications. With this method the notification also contains a Mail icon instead of a Terminal icon and the content of the message.

Feel free to extend, modify and use this script!


using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		set maxlen to 200
		
		set the notificationList to {"new Mail"}
		tell application "GrowlHelperApp"
			register as application ¬
				"myGrowlMail" all notifications notificationList ¬
				default notifications notificationList ¬
				icon of application "Mail"
			--notify with name "new Mail" title "TEST title" description "langer text" application name "myGrowlMail"
		end tell
		
		tell application "Mail"
			repeat with m in theMessages
				set sub to m's subject
				set sndr to m's sender
				set msgtxt to m's content
				if ((length of characters of msgtxt) > maxlen) then
					set AppleScript's text item delimiters to ""
					set msgtxt to (text items of characters 1 thru maxlen of msgtxt) & " ..."
				end if
				set msg to sub & " from " & sndr
				
				
				tell application "GrowlHelperApp" to ¬
					notify with name ¬
						"new Mail" title msg ¬
						description "" & msgtxt ¬
						application name "myGrowlMail"
				
				--do shell script "/usr/local/bin/growlnotify -I /Applications/Mail.app -m " & quoted form of msg & quoted form of msgtxt
			end repeat
		end tell
	end perform mail action with messages
end using terms from


[ Reply to This | # ]
A GrowlMail alternative
Authored by: mmnw on Dec 07, '10 11:25:59AM

You could also use Growls Apple Script support, it's build in and comes with Growl. So no need to install anything.
http://growl.info/documentation/applescript-support.php

Although, it's way more complicated to script than just using the command-line version.



[ Reply to This | # ]
A GrowlMail alternative
Authored by: Quatch on Dec 07, '10 12:47:51PM

I have this lying around from when 10.6 was new. I'm fairly sure it came from this site.

[code]
-- Growl Alerts in Mail
-- Hunter Ford [http://www.cupcakewithsprinkles.com]
-- This script arises from the lack of any Growl Support in Mac OS X Snow Leopard (10.6)
-- Code inspired by and adapted from James Higgs [http://blog.jameshiggs.com/2009/08/28/growlmail-on-snow-leopard-a-temporary-fix/] as well as those mentioned.

tell application "GrowlHelperApp"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to {"New Email"}

-- Make a list of the notifications
-- that will be enabled by default.
-- Those not enabled by default can be enabled later
-- in the 'Applications' tab of the growl prefpane.
set the enabledNotificationsList to {"New Email"}

-- Register our script with growl.
-- You can optionally (as here) set a default icon
-- for this script's notifications.
register as application "Mail" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Mail"
end tell

-- Mail Rule Trigger
--
-- Source: Benjamin S. Waldie [http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html]
using terms from application "Mail"
on perform mail action with messages theSelectedMessages for rule theRule
repeat with thisMessage in theSelectedMessages
-- Process the current message

-- Grab the subject and sender of the message
set growlSubject to subject of thisMessage
set growlSender to my ExtractName(sender of thisMessage)

-- Use the first 100 characters of a message
set growlMessage to (content of thisMessage)
set growlLength to (length of growlMessage)

if growlLength > 100 then
set growlMessage to (characters 1 through 100 of growlMessage) & "…"
end if

set growlMessage to growlSubject & "

" & growlMessage

-- Send a Notification
tell application "GrowlHelperApp"
notify with name "New Email" title growlSender description growlMessage application name "Mail"
end tell
end repeat
end perform mail action with messages
end using terms from

-- *ExtractName*
--
-- gathers the name portion from the "From: " line
--
-- Source: robJ [http://forums.macosxhints.com/archive/index.php/t-19954.html]
to ExtractName(sender_)
if sender_ begins with "<" then
return text 2 thru -2 of sender_
else
set oldTIDs to text item delimiters
try
set text item delimiters to "<"
set name_ to first text item of sender_
set text item delimiters to oldTIDs
on error
set text item delimiters to oldTIDs
end try
return name_
end if
end ExtractName
[/code]



[ Reply to This | # ]
A GrowlMail alternative
Authored by: burdell1 on Sep 07, '11 09:11:36PM

Is there a way to make it so when the growl email notification comes up, if i click on it, it automatically opens the email?



[ Reply to This | # ]
A GrowlMail alternative
Authored by: keytohwy on Dec 07, '10 05:19:39PM

I'm a relative new-comer to GrowlMail, but what exactly is wrong with it? It seems to work fine for me.



[ Reply to This | # ]
A GrowlMail alternative
Authored by: boredzo on Dec 08, '10 11:20:25AM

The current version of Mail rejects the current version of GrowlMail. We're developing a tool that users can use to test GrowlMail under the new version of Mail so we can determine whether it's safe to release a new version without changes or whether we need to fix anything.



[ Reply to This | # ]
A GrowlMail alternative
Authored by: keytohwy on Dec 08, '10 11:27:32AM

I modified the plist file per a previous hint and it seems to work just fine. I especially like receiving notices on my work MBP that personal mail has arrived on my iMac (while we are on the same network).

Having modified that file, and it is working fine, is there anything else I'm missing?



[ Reply to This | # ]
A GrowlMail alternative
Authored by: boredzo on Dec 09, '10 01:30:39AM

Not that we know of. That uncertainty is why we haven't pushed it as a release yet—there could be some incompatibility nobody has seen yet.



[ Reply to This | # ]