The document class is the top-level element of the Pages application. It contains sections, which contain pages.

The pages of this topic section detail how to open, save, make, close, and export Pages documents. This topic section begins with an examination of the document class contained in both the Standard Suite and Pages of the Pages scripting dictionary.

The Standard Suite Document Class

The Standard Suite is an element of most application scripting dictionaries. It contains a document class that defines three essential read-only properties: name, modified, and file. These properties are used in the example scripts of this topic section, to determine the status of the document being targeted in the scripts.

document : A document


contained by application.


name (text, r/o) : Its name.

modified (boolean, r/o) : Has it been modified since the last save?

file (file, r/o) : Its location on disk, if it has one. Returns missing value if no file exists.

responds to

close, exists, print, save

The Pages Document Class

The Pages Suite contains an extension of the document class of the Standard Suite. This suite also includes any elements and properties unique to the Pages application. In this suite, the document class has two elements, the page and section classes. This relationship indicates that the document must be referenced when creating, manipulating, or deleting sections or pages.

document [see also Standard Suite] : A Pages document


contains sections, pages.


body text (rich text ) : The document body text.

current page (page ) : The currently selected page.

document body (boolean, r/o) : Whether the document is set to word-processing mode containing a main text flow.

document template (template, r/o) : The template assigned to the document. This property’s value can be set during document creation.

responds to


In addition, this suite introduces a new property of the document class, current page, whose value is a reference to the currently selected page in the document. Use of this important property enables scripts to work regardless of which page is the current one.