By Dan Moren
June 19, 2017 12:19 PM PT
Last updated July 27, 2020
Automate This: Mail Merge with Pages and Numbers
Note: This story has not been updated since 2020.
When I was a kid, poring over tech books like The Macintosh Bible, I always found myself glossing over the sections about Mail Merge, which I–rightfully, I maintain–dismissed as something boring that only adults had to worry about.
So naturally here I am, twenty-five years later, in a situation where Mail Merge is actually quite useful: I’ve recently been sending out quite a bit of snail mail1, and I discovered that my printer could print envelopes (albeit one at a time, which is kind of a bummer). But rather than typing or copying-and-pasting addresses into the envelope template I set up in Pages, it seemed like it would save time to automate that process. Which is exactly what Mail Merge is supposed to do.
Except Pages doesn’t have a Mail Merge feature.
A little bit of Googling later and I turned up a solution from, of course, from my old Macworld colleague Chris Breen. Chris’s article in turn pointed me towards AppleScript guru Sal Soghoian’s Mac OS X Automation sites. Among the wondrous resources you can find there is a little helper application called Pages Data Merge, which did pretty much exactly what I was looking for.
Long story short, there’s a feature in Pages that lets you tag parts of documents as placeholder text. Those placeholders can then be addressed by scripts, and Pages Data Merge can import rows of data from Numbers (or other sources like a CSV file) and generate separate Pages files (or PDFs, ePubs, DOCs, and more) with the spreadsheet data plugged in to the template.
I used it to grab names and addresses that I’d entered in Numbers, plug them into the envelope template, and then generate individual Pages files for each personalized envelope–and it worked a treat. The one downside is that every time I want to do a new batch I have to remind Pages Data Merge which Numbers columns go to which Pages placeholders, but honestly, that doesn’t take more than 30 seconds or so.
Maybe this isn’t exactly the kind of low-hanging fruit that Apple’s looking to add to Pages, but it’s definitely a bit of a hole in functionality right now. It’s great that Apple’s robust automation (and Sal’s wizardry) means that you can make this work even without Apple building it in, but I would love to see a more robust solution.
In the meantime, if you’ve been looking for a way to personalize this kind of content–and I should note that Pages Data Merge even lets you automatically attach the created files to individualized email messages–then this might work as well for you as it has for me.
- Specifically, I’ve been mailing personalized signed bookplates for readers of my book. In case you’re interested. ↩
[Dan Moren is the East Coast Bureau Chief of Six Colors. You can find him on Twitter at @dmoren or reach him by email at email@example.com. The latest novel in his Galactic Cold War series of sci-fi space adventures, The Nova Incident, is available now.]
If you appreciate articles like this one, support us by becoming a Six Colors subscriber. Subscribers get access to an exclusive podcast, members-only stories, and a special community.