Mail Merge is an AppleScript replacement for the mail merge feature that was omitted from Pages 5.
Create a Numbers document with one sheet, containing one table, with one header row and no header columns. Fill with data. Create a Pages document (if it has body text, almost certainly ending in a page break), and write "%Column Name%" to reference data in the column from your Numbers table whose first (header) cell is "Column Name". Open both documents. Run script. Rejoice!
What’s new in version 1.1
Updated on Aug 25 2014
Version 1.1:
Fixed a bug that could cause first-time users to experience "System Events got an error: Can’t get button 4 of window 1 of process "Pages". Invalid index." number -1719 from button 4 of window 1 of process "Pages""
Thanks for making this available - I can't believe mail merge should be so exotic and difficult (near impossible) to execute with Pages for the average user! I ran the example script and it stopped at - Pages got an error: every document doesn’t understand the “count” message.
Thanks for the script. As it has worked for others, I hope it works for me; however, at the moment it does not. I get the following error when using the example, "Script Error Numbers got an error: Can’t get document 1." What am I doing wrong?
Thank you for this script! I was going crazy trying to get Numbers/Pages09 to do the mail merge and it just would not work. I ran this script just once and my mail merge was done. Worked perfectly. Thank you!
OSX 10.10.5, Pages 5.5.3, Numbers 3.5.3. Script fails on sample files: "error "System Events got an error: Can’t get button \"Acknowledgments\" of window 1 of application process \"Pages\"." number -1728 from button "Acknowledgments" of window 1 of application process "Pages"".
It worked beautifully with the sample Pages and Numbers files, but stalled on a real application with the error message:
System events got an error: Can't get window 1 of process "Pages". Invalid index.
Awesome. It could use an option to make multiple documents in addition to concatenating them. The script is currently creating an extra blank page at the end of the document, but that's an easy fix.