Skip to content

On the vagaries of saving from Mail

As I suspect is true of many of you, I buy a fair bit of stuff from Apple, whether in a physical Apple Store or in the various online stores. I receive electronic receipts for all these purchases, which look something like this (but with all the personal info filled in, obviously):

Until yesterday, I have just filed all these receipts in their own folder in Mail (in the On My Mac section, so they're stored locally). But in the process of going paperless, I wanted to move them directly to my hard drive, so I could store them in a more-organized manner, and keep them alongside my other receipts. That meant saving the messages from Mail to the disk.

I had only two objectives when saving:

  1. Maintain the formatting and images in the original receipt
  2. Have the message content indexed by Spotlight

You'd think this would be a simple proposition, but you'd think wrong…the above two criteria are basically mutually exclusive with Mail's Save As feature. Read on for the details, and my eventually-discovered workaround (and labor-saving shortcut).

Using Mail's Save As feature, there are three format options (Rich Text Format, Plain Text, and Raw Message Source). I tested each of these saving the files as PaperlessRTF, PaperlessPLAIN, and PaperlessRAW. Here's what I discovered:

Export MethodSpotlight SearchableRetains All Formatting
Plain Text
Rich Text
Raw Message Source

I was very surprised to find that Rich Text Format (.rtf) doesn't maintain the message as seen in Mail, but it doesn't: Any remotely-hosted images (the Apple logo and the book cover) aren't saved.

The Raw Message Source (.eml) file does contain the remotely-hosted images, but as has been true for forever, Spotlight will not parse .eml files, so nothing is added to Spotlight. You can see this in the results of a search for David Sparks, the book's author, across the three saved files:

The one format that retained 100% of the formatting is 0% searchable in Spotlight. Sigh.

The workaround

Although it's a bit more work, you can save a message with all formatting intact, and have it be Spotlight searchable. How? Use File > Print > Save as PDF to create a PDF of the Mail message. The end result matches the formatting of the original message, and is Spotlight searchable:

As a side benefit, all the links in the message—including the important Report a Problem—still work in the saved PDF. So if I need to request a refund, I can still do so.

Problem solved, right? Almost: Pressing Command-P, moving the mouse down to the corner of the dialog to click the PDF pop-up, then scrolling to and clicking on Save as PDF is slow and tedious—especially when I'll be doing it a lot.

The tips

So here's a little tip you may not be aware of: You can create a keyboard shortcut for the Save as PDF menu item (via System Preferences > Keyboard > Shortcuts > App Shortcuts):

This shortcut will only work after you invoke the Print dialog, but it clearly beats all the mouse work required to reach the Save as PDF menu item. Now I can press Command-P, wait a second, then hit Control-P to bring up the Save as PDF save sheet, saving a whole lot of useless mousing.

I actually took this one step further, and made a quick macro to do all of those steps with one shortcut:

Command-P > wait 1 second > Control-P

I used our own Butler to do this (and assign it a shortcut just in Mail), but any macro program can handle a simple task like this. The delay is needed to let the print dialog appear; I found a second worked, but you may have to change the delay based on your Mac.

Now I can save to PDF with a single keyboard shortcut, which makes it as painless to use as Mail's built-in Save as PDF feature. Problem solved!

3 thoughts on “On the vagaries of saving from Mail”

  1. Great tip! I've been doing this for years.
    When I first set up my Mac I'll change the keyboard shortcut for Save As PDF... to CMD+P (I never print anything but I remap the Print... command to CMD+Shift+P anyway).

    Then, whenever I get a receipt in Mail here's my workflow:
    + CMD+P brings up the Save dialog
    + typing doc;itns expands via TextExpander to today's date as yyyy_mm_dd_itunes.pdf
    + hit 'Return' to save and close the dialog
    + the file is saved in a folder called 'inbox
    + that folder is synced via BitTorrent Sync to my Mac mini (which serves as a server-ish device)
    + Hazel on my mini sees the file and moves it to my
    documents/receipts/apple` folder
    + done!

    The 'hardest' part is making sure that my inbox folder is selected in the save dialog. But OS X is pretty good about remembering your last location so it's usually already there. Otherwise, it's a 3 step process for the user and my iTunes receipts are saved forever.

    1. I can't get Save as PDF to come up via keyboard shortcut unless the Print dialog is first onscreen…oh wait, are you using Export as PDF? I didn't even notice that menu item; that would greatly simplify things :). Revisiting my own tip…

      thanks;
      -rob.

      1. Whoops. Yeah, totally meant Export as PDF…! I don't think that dialog gets you the PDF preview like the Print to PDF does but I typically don't need the preview.

Comments are closed.