FasdUAS 1.101.10 k l  Mail2Growl   Mail2Growl l   Growl Alerts in Mail * Growl Alerts in Mail  l % Wassim Jabi [http://wjabi.net]> Wassim Jabi [http://wjabi.net] l ^X Modified from the excellent script by Hunter Ford [http://www.cupcakewithsprinkles.com] Modified from the excellent script by Hunter Ford [http://www.cupcakewithsprinkles.com] l  If it exists, this script sends the photo of the sender to Growl from the address book. Otherwise, it sends the sender place holder image from Mail.app.2 If it exists, this script sends the photo of the sender to Growl from the address book. Otherwise, it sends the sender place holder image from Mail.app. l ! f` Original script found at [http://hunterford.me/growl-notifications-for-apple-mail-on-mac-os-x/]!"" Original script found at [http://hunterford.me/growl-notifications-for-apple-mail-on-mac-os-x/]#$ #l%& % This script uses a tip to summarise many messages by "Ryan" in the comments section at [http://hunterford.me/growl-notifications-for-apple-mail-on-mac-os-x/]&''< This script uses a tip to summarise many messages by "Ryan" in the comments section at [http://hunterford.me/growl-notifications-for-apple-mail-on-mac-os-x/]$() (l*+ *ke This script also used tips from [http://www.macosxtips.co.uk] for finding photos in the Address Book+,, This script also used tips from [http://www.macosxtips.co.uk] for finding photos in the Address Book)-. -l/0 /ke This script arises from the lack of any Growl Support in Mac OS X Snow Leopard (10.6) or Lion (10.7)011 This script arises from the lack of any Growl Support in Mac OS X Snow Leopard (10.6) or Lion (10.7).23 2l45 4 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.566: 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.378 7l89: 9l; ;O<= <k>>?@ ?lAB A0* Make a list of all the notification typesBCCT Make a list of all the notification types@DE DlFG F'! that this script will ever send:GHHB that this script will ever send:EIJ Ir KL KJMMN NmOOPPNew Email LlQ Qo ,0allnotificationslistallNotificationsListJRS Rl STU Tl VW V'! Make a list of the notificationsWXXB Make a list of the notificationsUYZ Yl [\ ['! that will be enabled by default.\]]B that will be enabled by default.Z^_ ^l `a `82 Those not enabled by default can be enabled laterabbd Those not enabled by default can be enabled later_cd cl ef e71 in the 'Applications' tab of the growl prefpane.fggb in the 'Applications' tab of the growl prefpane.dhi hr jk jJ llm mm nnooNew Email klp po 40enablednotificationslistenabledNotificationsListiqr qlrst sluv u& Register our script with growl.vww@ Register our script with growl.txy xlz{ z60 You can optionally (as here) set a default icon{||` You can optionally (as here) set a default icony}~ }l '! for this script's notifications.B for this script's notifications.~ I .registernullnull  appl mMail  anot o ,0allnotificationslistallNotificationsList  dnot o 40enablednotificationslistenabledNotificationsList  iapp mMail =mGRRRalisLion<*H+ JGrowlHelperApp.app J Resources<6p J J J EVLion:Library:PreferencePanes:Growl.prefPane:Contents:Resources:GrowlHelperApp.app&GrowlHelperApp.app LionLLibrary/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/: l l  Mail Rule Trigger$ Mail Rule Trigger l l qk Source: Benjamin S. Waldie [http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html] Source: Benjamin S. Waldie [http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html] w i I .emalcpmanull**** o *0theselectedmessagestheSelectedMessages  pmar o 0theruletheRule k! r I .corecnte******** n 2  cobj o *0theselectedmessagestheSelectedMessages o 0nN Z ! l ? o 0nN m  k. r b b m o 0nN m new messages o *0multipledescriptionmultipleDescription O. I- .notifygrnullnull  name mNew Email  titl b % b # m !You have o!" 0nN m#$ new messages.  desc m&'   appl m()Mail mGRRRalisLion<*H+ JGrowlHelperApp.app J Resources<6p J J J EVLion:Library:PreferencePanes:Growl.prefPane:Contents:Resources:GrowlHelperApp.app&GrowlHelperApp.app LionLLibrary/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/ X1! kC lCC " Process the current message8 Process the current message lCC lCC 1+ Grab the subject and sender of the messageV Grab the subject and sender of the message rCO nCM IDM 0 extractname ExtractName nDI 1EI  sndr oDE 0 thismessage thisMessage fCD o 0 growlsender growlSender QP rSd nSb ITb 20getphotofromaddressbookgetPhotoFromAddressBook nT^ IU^ *0extractemailaddressExtractEmailAddress nUZ 1VZ  sndr oUV 0 thismessage thisMessage fTU fST o 0 growlphoto growlPhoto R .ascrerr ******** rl Il~  .rdwrread********  4lt  psxf  mps    /Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.png   as mwzTIFF o 0 growlphoto growlPhoto r n 1  subj o 0 thismessage thisMessage o 0 growlsubject growlSubject r b b o 0 growlsender growlSender o  ret o 0 growlsubject growlSubject o 0 growltitle growlTitle l!" !0* Use the first 100 characters of a message"##T Use the first 100 characters of a message $% $r&' &l( (n)* )1  ctnt *o 0 thismessage thisMessage 'o $0growldescriptiongrowlDescription%+, +r-. -l/ /n01 01  leng 1o~ ~$0growldescriptiongrowlDescription .o} }0 growllength growlLength,23 2l|{z|{z345 4Z67yx 6?89 8ow w0 growllength growlLength 9mvvd 7r:; :b<= <b>? >m@@AA ?lBut BnCD C7sEF s cha Emrr Fmqqd Dop p$0growldescriptiongrowlDescriptionut =mGGHH & ;oo o$0growldescriptiongrowlDescriptionyx5IJ IlnmlnmlJKL KlkMNk M Send a NotificationNOO( Send a NotificationLPj POQR QQSTU SIihV i.notifygrnullnullhVgWX g name WmYYZZNew EmailXf[\ f titl [oe e0 growltitle growlTitle\d]^ d desc ]oc c$0growldescriptiongrowlDescription^b_` b appl _maabbMail`ac` a imag co_ _0 growlphoto growlPhoto` TR^]\ ^.ascrerr ********]\ Ukddef ergh gli[Z iIYjk Y.rdwrread******** j4Xl X psxf lmmmnn/Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.pngkWoV W as omppqqTIFFV[Z hoU U0 growlphoto growlPhotofrT rISRs S.notifygrnullnullRsQtu Q name tm vvwwNew EmailuPxy P titl xo  O O0 growltitle growlTitleyNz{ N desc zo  M M$0growldescriptiongrowlDescription{L|} L appl |m~~Mail}KJ K imag oI I0 growlphoto growlPhotoJT RmGRRRalisLion<*H+ JGrowlHelperApp.app J Resources<6p J J J EVLion:Library:PreferencePanes:Growl.prefPane:Contents:Resources:GrowlHelperApp.app&GrowlHelperApp.app LionLLibrary/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/j 0 thismessage thisMessage o45H H*0theselectedmessagestheSelectedMessagesemalalis.Lion<*H+Mail.app*mʜ Applications<ʜGVLion:Applications:Mail.appMail.app LionApplications/Mail.app/ lGFEGFE lDD  *ExtractName* *ExtractName* lCBACBA l@@ 60 gathers the name portion from the "From: " line` gathers the name portion from the "From: " line l?>=?>= l<< RL Source: robJ [http://forums.macosxhints.com/archive/index.php/t-19954.html] Source: robJ [http://forums.macosxhints.com/archive/index.php/t-19954.html] i I;: ;0 extractname ExtractName9 o8 8 0sender_9: ZC7 C o6 6 0sender_ m< L n 75 5 ctxt m 44 m33 o2 2 0sender_7 kC r 11 1 txdl o0 00oldtidsoldTIDs Q> k1 r$ m < 1 #/ / txdl r%+ n%) 4&). . citm m'(-- o%&, , 0sender_ o+ + 0name_* r,1 o,-) )0oldtidsoldTIDs 1-0( ( txdl* R'&% '.ascrerr ********&% r9> o9:$ $0oldtidsoldTIDs 1:=# # txdl" L?C c?B o?@! ! 0name_ m@A  TEXT" l l  *ExtractEmailAddress*, *ExtractEmailAddress* l l ?9 gathers the email address portion from the "From: " liner gathers the email address portion from the "From: " line l l RL Source: robJ [http://forums.macosxhints.com/archive/index.php/t-19954.html] Source: robJ [http://forums.macosxhints.com/archive/index.php/t-19954.html] i  I *0extractemailaddressExtractEmailAddress o  0sender_ ZF C o  0sender_ m< L n 7   ctxt m   m  o 0sender_ kF r 1  txdl o 0oldtidsoldTIDs QA k4 r' J# m < m !> 1#&  txdl r(.   n(,   4),  citm m*+  o()  0sender_  o  0email_  r/4 o/0 0oldtidsoldTIDs 103  txdl R .ascrerr ******** r<A o<= 0oldtidsoldTIDs 1=@  txdl LBF cBE oBC 0email_ mCD  TEXT l l i  I 20getphotofromaddressbookgetPhotoFromAddressBook  o 0sender_ k>!!"# "r $% $I &' .rdwrread******** &4(  psxf (m))**/Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.png'+  as +m,,--TIFF %o 0photo_#./ .Q ;012 0O'34 3r&56 56$78 7n9: 91  az50 :2  azf4 8E#;< ;n=> =1  az17 >2  az21 <o " 0sender_ 6o 0photo_ 4m??adrbalisNLion<*H+Address Book.app8ʡZi Applications<ʡ#Lion:Applications:Address Book.app"Address Book.app LionApplications/Address Book.app/ 1R .ascrerr ******** 2r/;@A @I/9BC .rdwrread******** B4/3D  psxf Dm12EEFF/Applications/Mail.app/Contents/Resources/SenderImagePlaceholder.pngCG  as Gm45HHIITIFF Ao 0photo_/J JL<>K Ko<= 0photo_LMNOPQL .emalcpmanull**** 0 extractname ExtractName *0extractemailaddressExtractEmailAddress 20getphotofromaddressbookgetPhotoFromAddressBook .aevtoappnull****MRS .emalcpmanull**** *0theselectedmessagestheSelectedMessages  pmar 0theruletheRuleR *0theselectedmessagestheSelectedMessages 0theruletheRule 0nN *0multipledescriptionmultipleDescription 0 thismessage thisMessage 0 growlsender growlSender 0 growlphoto growlPhoto 0 growlsubject growlSubject 0 growltitle growlTitle $0growldescriptiongrowlDescription 0 growllength growlLengthS- @GYampv~  cobj .corecnte********  name  titl  desc  appl .notifygrnullnull  kocl  sndr 0 extractname ExtractName *0extractemailaddressExtractEmailAddress 20getphotofromaddressbookgetPhotoFromAddressBook  psxf  as .rdwrread********  subj  ret  ctnt  lengd  cha  imag "-j EO#%%EO*%% UY[al kh)a,k+EO))a,k+k+EWX)aa/aal EOa,EO_%%EOa,EOa ,EOa!a"[a#\[Zk\Za!2%a$%EYhOP*a%a&a'a( W3X)aa)/aa*l EO*a+a,a'a( U[OY!NTU 0 extractname ExtractNameVV 0sender_T 0sender_ 0oldtidsoldTIDs 0name_U   ctxt  txdl  citm  TEXTD[\[Zl\Z2EY/*,EO*,FOk/EO*,FW X*,FO&OWX *0extractemailaddressExtractEmailAddressYY 0sender_W 0sender_ 0oldtidsoldTIDs 0email_X   ctxt  txdl  citm  TEXTG[\[Zl\Z2EY2*,EOlv*,FOl/EO*,FW X*,FO&PZ[ 20getphotofromaddressbookgetPhotoFromAddressBook\\~ ~ 0sender_Z}| } 0sender_ | 0photo_[{)z,y?xw]vutsEH { psxf z as y.rdwrread******** x azf4 w az50] v az21 u az17ts?)/l EO*-,[-,\Z@1EUWX )/l EOQr^qp_`o r.aevtoappnull**** ^kaa9nnqp_` Omnlkjihgf m,0allnotificationslistallNotificationsList l40enablednotificationslistenabledNotificationsList k appl j anot i dnot h iappg f.registernullnullokvEOkvEO* Uascr ޭ