Export Apple Mail Messages and Notes to Text Files

Tags: , , , , ,

I saw a Tweet from Scott Paterson, asking if there was an AppleScript to quickly batch export Notes from Apple Mail into individual text file.

Well Scott — If there wasn’t one before, there is now!

Features

  • This AppleScript will export any selected Messages or Notes in Apple Mail as individual text files to a temporary folder on your Desktop (called “Temp Export Folder”);
  • The script also attempts to remove any “illegal characters” from the file name as to avoid the process grinding to a complete halt!
  • If you have Growl installed, the script should detect it and notify you when your export is completed.

Current Limitations and Open Issues

(Otherwise known as “Places Where You Could Help Out!”)

  • I kept the output very basic — only spitting out the content of the note/message as the content of the text file. It *IS* possible to add more information from the messages and, if people are interested in that, let me know!
  • Errors that will undoubtedly arise when you do something that I didn’t think of or test for! ;)

How to Install and Use

First, select the messages or notes in Apple Mail.

Then just run the script… either:

  1. Manually;
  2. By using Snow Leopard’s “Keyboard Shortcuts”, or;
  3. By using FastScripts

Source Code and Download Link on the next page!

Export Apple Mail Messages and Notes to Text Files

Pages: 1 2

6 Comments / Jump to comment form

6 Responses to “Export Apple Mail Messages and Notes to Text Files”

  1. Twitter Comment


    Thanks to @veritrope for knocking up AppleScript to export Notes to text files from Mail.app [link to post]

    Posted using Chat Catcher

    • D D says:

      Thanks for putting this together. Two things: 1) Can I have the original dates exported with the notes? 2) The script fails because it requires Growl which I don’t have installed (I don’t really have a need for Growl). Do you have a version of the script that doesn’t need Growl?

      • Justin Justin says:

        The Growl issue must be a bug — it’s supposed to detect whether or not you have it installed and adjust. Click here to file a bug report so that I don’t lose track of it and, when I’m working on a new revision, I’ll spend some time on this!

        A question: How would you want the original dates presented? As a header at the top of the note?

        • lydia lydia says:

          for me, it would be useful to have basic messages headers placed at the top of each txt file. would love to see at least “From:”, “Subject:”, and “Date:”. would that be easy to add if i knew what i was doing?

          (i am about to take off on a big trip, am trying to create an archive of the relevant mail folder, don’t really have time to delve into learning applescript just now.)

  2. Danny Danny says:

    You just saved me about an hour. Thank you.

rss Subscribe to Comments RSS Feed


Trackbacks/Pingbacks

  1. Snow Leopard Issue With Mail, Exchange, and AppleScript rule | Veritrope
  2. AppleScript, MacHeist, Scottevest, Tavo, Hella, and Schneier | Veritrope

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>