Saving Documents

Scripts use the save command, from the Standard Suite, to save Pages documents to files on disk.

save  : Save a document.

save specifier : The document(s) to save.

[ in file reference ] : The file in which to save the document.

[ as Pages ] : The file format to use.

To save a document with a specific name and location, include the optional in parameter with the save command, and follow the parameter with a reference to the file to be created. This reference can be in an HFS file format or UNIX POSIX path format. Be sure to include the file extension “pages” with the file name.

save document 1 in file "Macintosh HD:Users:Johnny:Desktop:Report.pages"

save document 1 in "/Users/Johnny/Desktop/Report.pages"

Examples for exporting saved Pages documents in other formats, such as PDF, Microsoft Word, or EPUB, are detailed in the Exporting Documents page.

TIP: The script above uses the path to command to generate a disk reference to a standard user folder. Enumerations for other standard path to command locations include: documents folder/‌downloads folder/home folder/movies folder/music folder/‌pictures folder/public folder/temporary items/shared documents. For more information, view the path to command in the Standard Additions scripting dictionary.

TOP | CONTINUE