24 February 2012


Scripting replies

Thanks to TextExpander, I started looking for ways to improve productivity in another app I use everyday: Apple Mail. My problem is much in line with Elliot Jay Stocks, when he says the following:

Like many people, I find myself writing the same thing over and over and over again, with very subtle alterations.

Fortunately, Felix Geisendorfer shows how to automate parts of your reply, where for instance, when you hit the reply button, and trigger a TextExpander (AppleScript) snippet, it automatically pulls the name you’re replying to. In the example below, I have assigned ;re as a text-expansion trigger, powered by AppleScript, to pull salutation text and a “thank you” phrase to start the conversation; ;ks to pull signature text in-place.)


Here’s the snippet I am using, which is entirely based on Felix’s, with subtle changes in text and number of insert lines:

tell application "Mail"
    set selected to selection
    set msg to item 1 of selected
    set sentBy to (sender of msg)
    "Hi " & word 1 of sentBy & ", \n\nThank you for your email.\n"
end tell

Update (Jul 2017): See also Scripting replies in Outlook.

From Outlook Express to Apple Mail

  1. Install Thunderbird for Windows on a Windows computer or via Wine in Linux.
  2. Get, and install ImportExport Tools for Thunderbird plugin.
  3. Import Outlook Express .dbx files into Thunderbird.
  4. Using the above plugin, export to mbox.
  5. Import mbox mail archive into Apple Mail on OS X.

While going through my archived CD-ROMs earlier this week, I stumbled upon my old email backups. Interested in looking for a way to read this archive, I spent the next half hour scouring the internet for ways to convert these binary files ending with .dbx to the universal (and client-friendly) email format: mbox. I found none that I could use right away, most of the offerings being one form of commercial converter or the other.

Changing tack, I first tried importing it into Outlook on my work laptop that currently runs Windows 7, hoping it would recognize and allow me to import from it’s ugly sibling. It apparently looked for a specific location for these Outlook Express files, and the import eventually failed when it did not find the pre-designated path. (I do not know what that is, because the error wasn’t descriptive enough to try recreate this path so I could enforce the import).

Later that evening, over supper, I realized Thunderbird (for Windows) still had it within that it could import email from Outlook Express. I downloaded a copy on my work laptop, and installed it — despite limited user level privileges. To my luck, Thunderbird offered a way to import email from Outlook Express, and it read and pulled in all my old messages — pretty much flawlessly. Post import, I could merge inbox and sent message folders by copy-pasting all messages into one.

Next, I installed ImportExport Tools plugin on Thunderbird, which allowed me to export the merged folder into an mbox archive that Apple Mail could eventually read.