Modify Pages files by changing package contents

Mar 09, '05 09:51:00AM

Contributed by: n8_sl8er

Unlike most word processor documents, Pages' (part of iWork) files are actually packages. In the Finder, control-click on a Pages document you've saved and choose 'Show Package Contents.' A new window will open and show the guts of your Pages document. Inside, you'll find a 'thumbs' folder, 'Contents' folder, index.xml.gz file, and any media files you've placed in your document.

The thumbs folder holds a small image of what your whole document looks like. index.xml.gz is the markup file, which holds the actual text and defines the layout of your document.

This means that you can edit the media files in your Pages document without replacing them. Just modify the version that's inside the Pages document package. You can also replace actual media files in your document with symbolic links. This might be useful if you use your company logo in many different kinds of documents, and then make changes to your logo. If these documents use symbolic links to your logo file, you can simply modify your logo file, and you'll see the change the next time you open a Pages document that uses it.

As far as I can tell, Pages keeps your whole document in memory. Therefore, if you change something inside the the document package, you'll either have to close and reopen your document, or choose 'Revert to Saved' from the File menu, to see your changes.

[robg adds: If you're going to try modifying your documents in this manner, I strongly recommend a backup -- while it should work fine, I can see some strange results if, for instance, you replace a masked image with another. Also, if you share Pages' documents with others, the symbolic links will probably break when they try to open the actual file (not an issue with a PDF, obviously).]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050305195837253