Standard File Package

Macintosh applications typically have a File menu from which the user can save and open documents, via the Save, Save As, and Open commands. When the user chooses Open to open an existing document, your application needs to determine which document to open. Similarly, when the user chooses Save As, or Save when the document is untitled, your application needs to ask the user for the name and location of the file in which the document is to be saved.

The Standard File Package provides a number of routines that handle the user interface between the user and your application when the user saves or opens a document. It displays dialog boxes through which the user specifies the name and location of the document to be saved or opened. It also allows your application to customize the dialog boxes and, through callback routines, to handle user actions during the dialogs. The Standard File Package procedures return information about the user’s choices to your application through a reply record.

The Standard File Package is available in all versions of system software. However, significant improvements were made to the package in system software version 7.0. The Standard File Package in version 7.0 introduces

  • a pair of simplified procedures (StandardGetFile and StandardPutFile) that you call to display and handle the standard Open and Save dialog boxes
  • a pair of customizable procedures (CustomGetFile and CustomPutFile) that you call when you need more control over the interaction
  • a new reply record (StandardFileReply) that identifies files and folders with a file system specification record and that accommodates the new Finder features introduced in system software version 7.0
  • a new layout for the standard dialog boxes

If your application has no special interface requirements, you can use the StandardGetFile and StandardPutFile procedures to display the standard dialog boxes for opening and saving documents.

See Also