Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Pages 5.5 Mail and Data Merge

Pages 5.5 includes new scripting support for locating and replacing text placeholders. In addition, text placeholders can be "tagged" in the application interface, with script identifiers by selecting the text placeholder to tag and entering its "script tag" in the the new Script Tag field available at the bottom of the More tab in the format sidebar. With this new ability, scripts can replace the text placeholders in a document with data from other sources, including Numbers spreadsheets.


But you don't have to write scripts to take advantage of this new feature!


To make it easy for non-scripters to perform Mail merges, and other automated data merging tasks, there is a free application, the Pages Data Merge application, available at: http://iworkautomation.com/pages/script-tags-data-merge.html


Watch the movie, follow the instructions, and give it a try!

Posted on Oct 17, 2014 2:43 PM

Reply
174 replies

Jan 12, 2017 3:59 PM in response to Sal Soghoian

Last october I used this great tool on my Macbook Air. Now I want to use it again on my new Mac, but I get the error when running:

The document “xxx.pages” could not be exported as “xxx.pages”. You don’t have permission.

And back in Pages Data Merge: -10000: Pages got an error: AppleEvent handler failed.

What to do?

Regards, Linda

Jan 12, 2017 4:12 PM in response to Linda Menkhorst

Linda,

There's a bug in the latest macOS version (10.12.2) that breaks the export and save commands for scriptable applications, and the Data Merge application relies on those commands for Pages export. Until Apple releases a system software update with a fix, there's not much to do except try running the process on a computer not using this version. -- SAL

Mar 3, 2017 6:21 AM in response to Sal Soghoian

Sal,


The AppleScript write permission issue with 10.12.{2,3} involving saves and exports has been proven fixable with the following AppleScript incantation just prior to exporting, or saving a file:


-- fix for macOS Sierra 10.12.{2,3} export/save permissions error. Create the empty file before exporting to it.

-- source: Yvan Koenig, 2017-01-18, http://macscripter.net/viewtopic.php?pid=188721

close access (open for accessexportDocumentFile)


This has resolved my export issues from Pages v5.6.2, and v6.0.5, both on Sierra, where they consistently failed beforehand.

Mar 3, 2017 7:28 AM in response to Linda Menkhorst

My post was intended for Sal, as the implementor, to assess, and determine if it is suitable/possible for inclusion within his application. It won't be of any value to you, as an end user, in concert with Sal's current Pages Merge application revision. It is unknown when Apple will fix Sierra, and/or Pages itself to resolve this issue without a kludge.


That single line of code did fix the same underlying write permissions error that I was having in custom AppleScript that was Saving/Exporting to a file.

Jun 27, 2017 1:09 PM in response to Sal Soghoian

This actually worked! It's very tedious and I will likely never make labels with Pages again, but you can end up with a page of labels with multiple records and not just the same address over and over. Since I only had 3 labels on my page it was easy. I can imagine 30+ would be awful to work with, but still doable. It took me awhile to figure out Sal's example above, so here's a visual of my data file.


In your spreadsheet or data file, put a number next to your placeholder titles and put each in separate columns. Using my example below, on your Pages doc, simply put your first record as Title, First, Last, then your next record would be 1-Title 1-First 1-Last, and so on. Although not ideal, you can make as many columns as you need. My data file looked something like this:


Title First Last 1-Title 1-First 1-Last 2-Title 2-First 2-Last

Mr. John Smith Mr. David Johnson Mrs. Amy Jones

Mrs. Isabel Aguilar Mrs. Susan Titus Mr. Sam Thompson


There may be a better way to configure the data file, but this worked for me. I only figured this out after finally finding Sal's post and researching and failing for about 10 hours. Hope this can help someone else.


Apple really needs to update Pages to include an option where multiple records can be on the same page with the same placeholder. But for now - thanks for this work-around Sal!

Jun 29, 2017 1:42 AM in response to Sal Soghoian

I have this exact problem too! OS 10.12.5, Pages 6.2, Numbers 4.2. Numbers 09 is present on the computer but not open. The pages doc with script tags and the numbers sheet with some data highlighted are both open before I start the Data Merge App. I have quit more or less everything else and tried it several times, always with the same result.

Help!

Oct 21, 2017 9:30 PM in response to Sal Soghoian

Hi Sal,


I have just download this app for the first time tonight and it has been a real life saver. Reading through the threads from over the past 3 years I can see you have thrown a lot of passion and sweat into this app. Great job and thank you for sticking with it. I found out about this app from Macworld and ThoughtCo. You are making an impact. Thanks.

Oct 19, 2014 10:16 AM in response to Sal Soghoian

Hi Sal,

this message ist fantastic for me! Thank you very much. It seemed to be a very good job! I´m a "normal" user and i missed the data merge feature a lot. Your Pages Data Merge App give us the data merge feature back!

Questions: 1) Is there a possibility to get as the result not single pages files, but one document with the whole merge datas? In iwork 09 there was a switch to choose it. 2) A little nice icon is missing :-)

Oct 19, 2014 11:21 AM in response to bossa

Thanks for the feedback!


Let me make sure I understand your request. You want the output to be a single file containing merged content? Is that correct?


If so:


1) Since the Pages Data Merge application works with both word-processing OR layout documents, which text would you want to be part of the merged flow? Only the text from the main body in word-processing mode? What about other any other text boxes in the document? What if the document does not have a main body text flow?


2) I assume you would still want to be able to choose the output format? Pages, unformatted text, MS Word, PDF, etc.


Thanks,


Sal

Pages 5.5 Mail and Data Merge

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.