How to Create a Pages Mail Merge

The information below applies to macOS 10.14 (Mojave). The third-party app described here is no longer supported.

What to Know

  • Download the Pages Data Merge app and prepare a spreadsheet with mailing data. In Pages, open a template (such as an envelope).
  • Click Format > More, highlight each placeholder text, then click Format > Advanced > Define as Placeholder Text.
  • Open Pages Data Merge and then assign placeholder tags, define the export file's format and location, and run the mail merge.

This article explains how to create a mail merge in Pages. Pages doesn't have a built-in mail-merge function, so the method below relies on a third-party app called Pages Data Merge. This method has been tested only on macOS 14 (Mojave), and the app is no longer in development.

Create a Form File

The first part of this process is creating a form file in Pages:

  1. Download the Pages Data Merge app and unzip the zip file. macOS puts the file into a folder named PagesDataMergeApp.

  2. Define each item of placeholder text to be filled with information from the spreadsheet data file (see below), for example, first name, last name, and address. Click Format > More.

  3. On the envelope, highlight each placeholder text, starting with FIRSTNAME.

  4. In the top menu, click Format > Advanced > Define as Placeholder Text.

  5. In the formatting menu at the bottom, under Script Tag, type a name for this placeholder text field. This example uses FIRSTNAME.

  6. Repeat step 4 for each placeholder text item that corresponds to data that will be imported from the spreadsheet: LASTNAME, STREET, CITY, STATE, ZIP.

    If your spreadsheet has column headers, the headers don't have to match the placeholder text names (for example, FIRSTNAME and LASTNAME).

Open the Data File in Numbers

In Numbers, open the spreadsheet with the names and addresses that will populate the placeholder text defined in step 2. Select all cells with data you want to include in the mail merge. The mail merge app imports only the items you have selected in this step.

Data file spreadsheet in Numbers for mail merge

Assign Placeholder Tags

Next, you'll tell the app which fields correspond to which bits of data, and where to find the data.

  1. Open Pages Data Merge by double-clicking the unzipped app file named Pages Data Merge.

    The app is labeled with numbers for each setting you'll use to create the mail merge.

    Assigning placeholder tags in Pages Data Merge app
  2. Next to 1 in the app, click the menu and choose Selection Numbers Table. Click Import. The first row is pulled in and displayed.

  3. Select the first item imported (in this case, the name James).

  4. Next to 2, click the drop-down menu and choose the placeholder tag FIRSTNAME (the first placeholder text item defined).

  5. Repeat steps 2 and 3 for each item imported until all items are assigned placeholder tags. For example, select Jones and choose LASTNAME from the drop-down menu.

  6. Next to 3 in the app, choose the file format you would like the mail merge to use for each envelope. In this example, we select Pages Document. Other options are:

    • Microsoft Word Document.
    • MS Word Doc (encrypted).
    • PDF Document.
    • PDF Document (encrypted).
    • EPUB.
    • Unformatted Text.
    File format selection in Pages Data Merge app

Choose the Export File's Format and Location

Next to 4 in the app, click Choose Export Folder and select the location for the merged files to be saved.

Number 5 in the app is an optional function you can use to automatically send individual emails related to the mail merge.

Run the Mail Merge

Now that you have assigned placeholder tags from the Pages document to the data items imported from the Numbers data file, you're ready to run the mail merge.

Next to 6 in the app, click Begin. You're prompted to confirm that you want to perform a data merge using the front Pages document. Click Begin.

The mail merge AppleScript you designed with the app runs. A Pages document is created for each person in the spreadsheet and is populated with names and addresses. You'll see each of these pop open and the data added before the script moves on to the next one.

Successful mail merge with Pages Data Merge app

Each file is named after the envelope template with a number appended after a dash, for example, mailmerge_envelope-1, mailmerge_envelope-2, and so on.

When the script finishes, a completion dialog box appears. If you click Show, you are taken to the folder in which the individual files are saved.

Was this page helpful?