Blogged Et Animam Levavi

17 Responses

Subscribe to comments with RSS.

  1. Irene said, on February 28, 2006 at 16:47

    This is a great script. i am in the process of sitching from Eudora to Mail and had a similar script for Eudora, Howvere, I;d like it even better if this cript would announce not the email part before the @ sign, but the name of the perosn which is often included before or after that email address.
    For example: Jonathan Miller may email as jrm@xyz.com and rather than here “jrm” which probably sounds like “germ” I’d like ti to say “Jonathan Miller”
    Can you help?

  2. George Sudarkoff said, on March 2, 2006 at 11:45

    The line ’set the_sender to extract name from sender of a_message’ extracts the name of the sender from email header, not their email address. Unfortunately, for this to work correctly the field From: should include the name of the sender. It should look something like this:
    From: Jonathan Miller <jrm@xyz.com>
    If it doesn’t — that’s why you hear “germ”.
    There’s couple of things you can do about it. First, and I understand that it’s not always possible, you can ask Jonathan to configure his email client to always put the name in the From: field. Most probably all it takes to achieve that is to fill in the name field of the account settings. Second, you can try and parse the signature from an email message, but I wouldn’t advice taking this route as it is not a simple task. Finally, you can create a LUT (look-up table) and manually populate it with custom names of your regular senders. This is the easiest and most reliable way of solving the problem. Please let me know if you need further help.

  3. Mark said, on December 9, 2008 at 11:54

    Is there a way to just get it to say “you got mail” or something to that effect rather than the senders name?

  4. George Sudarkoff said, on December 9, 2008 at 12:04

    Mark, just replace this line:
    say “Mail from ” & the_sender
    with something like this:
    say “You got mail.”

  5. Kayla said, on January 18, 2009 at 13:24

    How do you get this to work? I can get into the Apple Script editor, but I have no clue where to go from there. Thanks!

    • Marco said, on June 1, 2009 at 15:07

      Ok this is for Kayla: first copy the code above, then open Apple Script Editor, create a new document, paste the code, [DON'T CHANGE ANYTHING], save it as a script (Give it a name) and place it on ~/Library/Scrpts/Mail Scripts (If Mail Scripts doesn’t exist create it) btw “~” means the User name such as “John”, now open Mail, then mail preferences, and go to rules, create a new rule put any description you want like “Announce New Mail” then if ANY of the following conditions are met:, FROM, CONTAINS, then type “@” without the quotes, then where it says Perform the following actions: choose RUN APPLESCRIPT, then select the scripts from the folder where you placed it which is ~/Library/Scripts/Mail Scripts and Voilà! Test it with music playing on iTunes of course and ask someone to send you a e-mail message or just message yourself. IT SOUNDS BEAUTIFUL!!!

  6. Mausy5043 said, on July 5, 2009 at 23:12

    Hi,
    The script is great. I just love it. However… I also use Mail to receive RSS articles. Whenever an RSS article arrives, the script pauses iTunes but doesn’t restart it. I’ve added an errorhandler and found that an error is generated (-1728 Can’t get <>). Obviously, there is no From: header in an RSS article. This causes the error. But, now I’m at a loss how to solve this.
    Is there a way to detect the type of message (RSS or email) so I can distinguish between them, “say” different things and (most importantly) restart iTunes again?
    Thanks, Mausy5043

  7. ryan said, on November 12, 2009 at 16:26

    Hi – I love the concept of this script however I am having a problem. I am using SL with Mail.app 4.2. The script announces the name of the previous email vs the latest email that came in. Any ideas?

    • Dan said, on December 1, 2009 at 14:39

      Love it also. But, I have the same problem with Mail 4.2.

  8. Greg Batla said, on November 16, 2009 at 12:58

    Awesome script! Thanks so much for sharing this.

  9. sami said, on December 1, 2009 at 16:38

    this is a great script! works fine too…
    i was wondering who i can make it say:

    You have an email from [sender] with the subject [subject]

    i tried
    say “You have an email from ” & the_sender & “with the subject ” & the_subject

    this doesn’t work. i take it that i’ve made a mistake with the “the_subject” part. can anyone help?

    thanks!

  10. sami said, on December 1, 2009 at 16:48

    oh i just got it…
    just had to add the following line:
    set the_subject to extract name from subject of a_message

  11. [...] всего скачайте и сохраните сценарий. Потом в настройках Mail создайте [...]

  12. emilcar » Reglas interesantes en Mail said, on December 7, 2009 at 01:02

    [...] de música en iTunes que tengamos en marcha en ese momento. Para empezar vamos a la web de George Sudarkoff y copiamos el texto del script que ha diseñado para anunciar la llegada de emails. En nuestro Mac [...]

  13. andyman online: AppleScript Email Announcer said, on December 17, 2009 at 01:01

    [...] Link [...]

  14. E-z said, on February 11, 2010 at 10:13

    Hey, i have been looking all over for something kinda like your script, well at least part of it.
    Mail’s dictionary isn’t very helpful i guess if you don’t know what your looking at lol.
    Anyway, i was hoping some one could help me out… I need to extract the name, if there is one, and the address, and then where you have it “say” something i would just leave it open so i could use the variables “the_sender” and my “the_address” for other things. I cant get it to extract the address no matter what I do.

    so basically just this…
    on perform_mail_action(info)
    tell application “Mail”
    set the_messages to |SelectedMessages| of info
    repeat with a_message in the_messages
    set the_sender to extract name from sender of a_message

    (*if (junk mail status of a_message) is not true then
    say “Mail from ” & the_sender
    end if*)

    end repeat
    end tell
    end perform_mail_action

    • E-z said, on February 11, 2010 at 10:18

      Hey any comments are still appreciated, however I think I may have just done it, and I don’t know how.

      tell application “Mail”
      set theSelection to selection
      set theMessage to item 1 of theSelection
      extract address from sender of theMessage
      end tell


Leave a Reply