The document class is the top-level element of the Numbers application. It contains sheets, that contain tables, that contain cells, columns, rows, and ranges.
The pages of this topic section detail how to open, save, make, close, and export Numbers documents. This topic section begins with an examination of the document class contained in both the Standard Suite and Numbers 09 Compatibility Suite of the Numbers 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 n [see also Numbers 09 Compatibility Suite] : 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.
close, exists, print, save
The Numbers Document Class
The Numbers Suite contains an extension of the document class of the Standard Suite. This suite also includes any elements and properties unique to the Numbers application. In this suite, the document class has as an element, the sheet class. This relationship indicates that the document must be referenced when creating, manipulating, or deleting sheets.
document n [see also Standard Suite] : A Numbers document
active sheet (sheet ) : The active sheet.
document template (template, r/o) : The template assigned to the document. This property’s value can be set during document creation.
In addition, this suite introduces a new property of the document class, active sheet, whose value is a reference to the currently selected sheet in the document. Use of this important property enables scripts to work regardless of which sheet is the current one.
NOTE: The active sheet and document template properties are new in Numbers. Scripts using this property will not be backward compatible with Numbers 2009.