PHP, Programming

Export iMessages and SMS conversations as HTML

A couple of years ago, I explained how to get instant message conversations exported out of iChat as HTML files. Now it’s 2016, and Messages has replaced iChat, and iMessages have replaced all interpersonal communication. So how do you get HTML transcripts of your iMessages and text messages? Here’s how: with my new OSX Messages Exporter script.

The script exports all of your text/iMessage conversations from Messages (including group chats) and generates HTML files for each conversation. Here’s a screenshot of the HTML file generated for a iMessage conversation between me and my brother:

Screen Shot 2016-06-20 at 10.15.35 PM

And here’s what a group conversation looks like:

Screen Shot 2016-06-20 at 10.22.55 PM

(For a look at the actual HTML, see the example.html file in the repository.)

I’ll admit that there are a number of existing solutions for exporting conversations out of Messages, but mine has some distinct advantages over them:

  1. It supports group conversations.
  2. It generates human- and machine-readable HTML.
  3. It saves all attachments.
  4. It uses contacts’ names, not just their phone numbers.
  5. I wrote it.

If you want to give it a spin, download it from GitHub and run

./messages-exporter.php --help

from the command line for the current usage instructions.


2 comments on “Export iMessages and SMS conversations as HTML

Leave a Reply

Your email address will not be published.