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:
- Maintain the formatting and images in the original receipt
- 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 Method||Spotlight Searchable||Retains All Formatting|
|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.
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.
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!