In Pages, Apple’s word processor, creating a mail merge works a little differently than in other word processing programs. In fact, Pages does not have a built-in merge function.
However, there is a method to merge email with pages using AppleScript, a scripting language in macOS that allows you to create your own automation tasks. AppleScript is very useful, but for most of us who don’t know how to use it but still want to do a mail merge, it feels like a non-beginner.
Here we make it easy for you. With an application called Page Data Merge, you create a custom script specifically designed to perform a merge with Pages and Numbers. The simple interface of the app is easy to use, so don’t let the mention of AppleScript worry you.
- What is a merger?
- Download Data Page Merge App
- Create a form file in pages
- Open the data file in numbers
- Assign placeholders
- Select the format and location of the export file
- Perform mail merge
What is a merger?
Letter bundling is a tool for creating mass mailings such as form letters or addressable envelopes. The data file—usually a spreadsheet (in our example, we’re using the Apple Numbers app)—contains the data that fills the form. We will use an envelope created in the Apple Pages application as the shape.
Download Data Page Merge App
As a preliminary step, download the Page Data Merge application. You will find the download link at the bottom of the page. The downloaded file is a ZIP file. When you double-click it, your Mac will extract it to a folder called PagesDataMergeApp.
Create a form file in pages
We use a simple envelope template in Pages. Mail merge allows us to create separate envelopes addressed to each person in our database.
Define any placeholder text that will be populated with information from our spreadsheet data file (we’ll move on to the table below), such as the person’s first name, last name, and address.
Click Format in the upper-right corner of the Pages window to open the formatting menu on the right. Then go to the tab Lake .
On our envelope, mark each text placeholder, starting with FIRSTNAME.
Click in the top menu on Format > Additionally > Define as placeholder text .
In the formatting menu at the bottom, below the script tag, enter a name for this temporary text box. In this example we will use the name FIRSTNAME.
Repeat step 4 for each placeholder text element that matches the data being imported from the spreadsheet: SURNAME, STREET, CITY, STATE, ZIP.
Open the data file in numbers
In Numbers, open the spreadsheet with the names and addresses that will fill in the placeholder text we defined in Step 2. Select all cells that contain the data you want to include in the merge. The Mail Merge application imports only the items selected in this step.
If your spreadsheet has column headings, they should not be the same as text placeholders (e.g., FIRSTNAME, LASTNAME, etc.).
Open the Page Data Merge application by double clicking on the extracted application file named Merge page data .
You will see that the application is labeled with numbered labels for each setting you will use to create the merge process.
Near a in the application, open the drop-down menu and select song selection table . Click Import . The first row is pulled out and displayed.
Select the first imported element, in this case the name James.
Near 2 in the application, open the drop-down menu and select the placeholder tag FIRSTNAME (this is the first placeholder text element we defined).
Repeat steps 2 and 3 for each imported element until all elements have been assigned a placeholder tag. For example, select “Jones” and then select SURNAME from the drop-down list.
Select the format and location of the export file
Near 3 in the app, select the file format you want to use for each envelope. In this example we choose: Document pages . Other options to choose from:
Microsoft Word Document
MS Word Doc (encrypted)
PDF document (encrypted)
Near 4 in the app, click on Select export folder and select the location where you want to save the merged files.
The number 5 in the application is an optional feature that can be used to automatically send individual emails related to email aggregation. We will not use it in this example.
Perform mail merge
Now that you’ve mapped the placeholder tags from the Pages document to all of the data elements imported from the Numbers data file, you’re ready to perform the merge.
Near 6 in the app, click on To start to start the merge. You are prompted to confirm that you want to merge data using the first pages of the document. Click To start .
The AppleScript merge you created with the application runs. A page document is created for each person in the spreadsheet and populated with their names and addresses. You will see each of these popups and the data added before the script moves to the next one.
Each file is named after an envelope template with a number after the dash. For instance, mailmerge_envelope-1, mailmerge_envelope-2, and so on.
When the script is complete, a completion dialog box appears. Clicking “Show” will take you to the selected folder to save individual files.