macOS: How to Archive iMessages with Automator

Using Automator, it’s possible to archive iMessages on your Mac. Apple is bringing iCloud backup to iMessages with iOS 11 and macOS Sierra. Not everyone is comfortable backing up to iCloud though, so you can create your own backups in case something goes wrong and your messages get erased.

Exporting iMessages

Besides creating a backup, you can also export iMessages as PDFs. But it can only save part of the conversation, not the whole thing, although it presents your messages in a nice, readable format. The method that I created will export your messages in the iChat file format.

Using Finder

  1. First, we’ll need to find out where your Mac stores the iMessage archives. Open Finder, and in the menu bar, click Go > Go to Folder.
  2. Next, copy and paste this file path into the popup window: ~/Library/Messages.
Screenshot of the messages folder. This lets you archive iMessages.
Finding the messages folder.

You’ll see two main folders of interest: Archive and Attachments. The archive folder contains the actual iChat logs, sorted by date. The attachments folder contains, well, the message attachments. These could be whatever you shared with your friends, like photos.

Now, you could just stop here and manually copy and paste all of those folders every so often. And that’s perfectly fine. Since the Messages folder also contains metadata, I would just copy/paste the whole thing, just to be safe. (Instead of just saving the archive and attachments folders, for example.) But if you don’t want to think about it, or worry you’ll forget, here’s how to do it automatically.

Using Automator

We can use Automator to create a Calendar Alarm and have it archive messages every week or day.

  1. Open Automator, and select Calendar Alarm as your document type.
  2. In the sidebar, everything we need is found under Files & Folders. We need three actions: Get Specified Finder Items, Create Archive, and Rename Finder Items.
  3. First, drag Get Specified Finder Items from the sidebar, then Create Archive.
  4. In the first action you’ll need to input the folder you want. If you open Finder and navigate to ~/Library, you can simply drag and drop the Messages folder into the action.
  5. Next, in the Create Archive action, you can name the zip file it creates something specific, or leave it as is. You’ll need to specify where you want the file saved. This could be anywhere on your Mac, or perhaps an external hard drive.
  6. In the Rename Finder Items, you can add a date & time to the file name for better cataloging.
  7. Now, run the action by clicking the Run button in the upper right to test it. Then you can press Command (⌘) + S to save the alarm. I named mine iMessage Archiver.

Using automator to archive iMessages.

Once Automator saves the alarm, it will open Calendar and run it immediately. But we want it to run on a schedule. So in Calendar, double-click the event it created. From there, you can specify the date and time you want it to run. Make sure to set it on repeat.

That’s it! We’re done. If your messages ever get deleted—accidentally or on purpose—you can do into your archive. For any conversation you want back, you can simply double-click the iChat file.


A comment from The Mac Observer reader Scott suggests this workflow doesn’t go far enough. A couple of caveats to add: This only works if your Mac and iPhone share the same Apple ID account. Second, you’ll want to open the Messages app on your Mac first, so all of the conversations can download.

To work with this, we can add three more actions to our Automator workflow. In the beginning of the workflow, add Launch Application so it opens the Messages app. Next, a Pause action after this and set the amount of time we want it to wait. I would go all the way up to 10 seconds, just to be safe.

After you add Pause, you can continue with the other workflows as I wrote above. At the very end of the workflow, adding Quit Application will make Automator automatically close Messages. Make sure that the Ask to Save Changes checkbox is not checked.

4 thoughts on “macOS: How to Archive iMessages with Automator

  • There are a few caveats with this suggestion. First, this will only work for messages on your Mac unless you have it set up with the same Messages account that is used on your iOS device. Second, if you want to back up the messages that you sent from your IOS Device then you have to open the Messages app on your Mac so it will save the archived messages. It will not download the messages in the background without the app being open.

    To make this work, I would add the “Launch Application” at the beginning of the Automator script. That would open the Messages app. The next command adds the “Pause” command and lets the action wait for about three seconds so what that it can download iOS messages to your Mac’s archive.

    Then, I would add the “Quit Application” to quit the Messages Application before you exit. Make sure the “Ask to save changes” checkbox is not checked.

    By doing this, I think the Automator script will be a little more robust and work the way you intended.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WIN an iPhone 15 Pro Max!

Enter our epic giveaway for a chance to win the latest iPhone 15 Pro Max!