Apple Event: May 7th at 7 am PT

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

Oct 19, 2014 12:55 PM in response to Sal Soghoian

My suggestion is not that complicated. The result of the data merge app are individual files. I want a single file with all the data merged content. May be there are separated by page separators (i dont know the correct englisch impression). The output format is not my problem. The data merge app lets me select the output format, i want to get.

Oct 19, 2014 1:21 PM in response to bossa

My apologies for not being clear. Let me try again.


1) Am I correct in assuming that you want the merged document content repeated in a single output document? So if the document to be merged is 4 pages in length, you would like to have those same 4 pages appended to the same document for each spreadsheet row that gets processed? This includes pictures, movies, etc. that are part of the document?


2) What is the ultimate use of the single-combined document? What do you do with the combined content document?


3) Am I correct in thinking that your source document is a word-processing document (not a layout document) and you're only interested in repeating the main body flow for each spreadsheet record?


Thanks!

Sal

Oct 19, 2014 3:10 PM in response to bossa

Ah, I understand! So the eventual use is to _print_ the documents.


No problem. The Pages Data Merge application might be fine just as it is. Try this:


1) Use the output to PDF option. Using this setting will create a folder with the individual files as PDF files

2) Instead of printing each PDF file, one-at-a-time, by opening each file, choosing Print, etc., simply either drag the files from the created output folder:

• Into the print job window for your Printer Queue application; or…

• open Home > Library > Printers folder and drag the PDF files onto the icon for the printer


Using the drag method should print all of the documents automatically for you without you having to open them!


Cheers,

Sal

Oct 20, 2014 6:35 AM in response to Sal Soghoian

Sal,


The old Mail Merge to a single document with section breaks between the versions of the source document was also useful for things like labels where you actually want multiple entries on a single page. It was possible to do that with a Find and Replace to change the section break to a return.


I suspect that now you would have to use AppleScript for the Find and Replace, because the version in Pages 5 doesn't work with breaks and returns.


Jeff

Oct 20, 2014 9:17 AM in response to Jeff Shenk

Interesting. Since text placeholders "disappear" once they've been replaced, it may be possible to process and entire page of labels using positional location of remaining placeholders. However, I think a better approach is to use the script tags to give each label group a unique identity.


For example, say a single page of labels contains 10 label groups (a label group being a set of identified text placeholders). The script tags for the first label group could be tagged like this: 1-First Name, 1-Last Name, 1-Address, etc. the second group could be 2-First Name, etc. A script could then do the following:


  • extract act a row from the source data and parse it into match script tags: cell 1 = first name, etc.
  • locate the text text placeholders on the current page that begin with the current loop number, like 1, 2, 3, etc.
  • replace those tags with the row data
  • repeat while iterating the loop number
  • when a page has no more placeholders, generate a new page of the template document and reset the loop counter


Using this his technique a script could process sheets of labels!


interesting. Let me look into this. If I come up with a solution, I'll post the script on the website.


THanks!

Oct 21, 2014 9:08 PM in response to Sal Soghoian

Sal


This is really a great tool and your website offers such great info.


I have to agree with Jeff and bossa and exporting to a single file would indeed be useful. Creating mailing labels from a numbers or CSV file would be very helpful. Likewise, producing either a multipage Pages file and/or an multipage PDF would also be very useful. Often I am creating docs (PDF from Pages) that get sent to a print shop and having them in one document has proved to be very helpful in ensuring that everything gets printed and keeps the file size low.


With that in mind, when Pages Data Merge creates a PDF, what are the quality settings used? By default, unfortunately, Pages uses "Good". "Best" would be a better choice. Does Pages Data Merge create the highest quality PDF export? If not, could there be an option to do so?


Thank you for putting together this great app. I'm sure I will get great use out of it.


Christopher

Oct 21, 2014 10:22 PM in response to ckulesa

Thank you for the great feedback, and it's great that you find the application useful.


I've already created an example label template that uses script tags and am working on a script for transferring spreadsheet data to the labels. Interesting. I'll post when I get all the issues resolved and working correctly.


As for creating a single PDF file, that's a single-click using the folder of output PDF files and this free system-service: <http://macosxautomation.com/automator/combinePDFs/index.html>


As for quality, I'm looking into what the settings are.


Thank you all for the useful feedback.

Oct 22, 2014 8:02 AM in response to bossa

I will joyfully look forward when Apple gives me something to look forward to. overall, I remain a user and fan of what they do. But the future looks very dark indeed for pages: over a hundred features deleted, file format nightmares, and no indication whatsoever of a roadmap for something more powerful or sensible.


So for now, I'm stuck in the past until they make me jump to Nisus or the like. At least Yosemite gave Pages a nice little facelift!

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.