Using Templates in Document Creation

The ability to create a Pages document using a specific template is enabled by the inclusion of the document template property of the document class.  (⬇ see below ) 

The Pages Suite Document Class (excerpt)

document : The Pages document.

elements

contains sections, pages; contained by application.

properties

current page (page ) : The selected page in the document.

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

The value of the document template property  (⬆ see above )  is the template currently used (or to be used) by the document in the display of its contents.

NOTE: The document template property is currently read only (except when used with the make command) and cannot be used to change the current template of a Pages document.

The script below demonstrates the use of the make command to create a new document with a template chosen by the script user:

The following script, a variation of the previous script, creates a new Pages document using the application template chosen by the script user:

The following script is designed to create a new Pages document using a specific user template. If the user template is not installed on the computer running the script, the script will prompt the script user to download the specified user template from the company website, and will display the company-hosted website page containing the template if the user desires.

TOP | CONTINUE