Making Documents

Creating new Pages documents is done using the make command from the Standard Suite. The optional with data parameter for the make command is currently not supported in Pages.

make  : Create a new object.

make

new class : The class of the new object.

[ at location specifier ] : The location at which to insert the object.

[ with data any ] : The initial contents of the object.

[ with properties record ] : The initial values for properties of the object.

⇒ specifier : The new object.

Using the make command, scripts can create Pages documents using the default template, as shown in the example script below:

Here’s a script demonstrating how to use the optional with properties parameter to make a new document based upon a specific template:

In the current version of Pages there is a template, named “Blank,” for creating a blank word-processing document. There is no corresponding template for creating a blank page-layout document. A script can use the value of the document body property to determine whether a chosen template is designed for use as a page-layout document, and then delete all of its existing page items.

IMPORTANT TIP: Learn how to save and run your favorite scripts using the system-wide Script Menu.

TOP | CONTINUE