You are currently browsing the archives for the Pages category.

Posted on 20 August 2008 at 7:57

Permalink to the post entryScripting Pages

So far, we’ve dumped the output from our scripts into Microsoft Word. In this post, we’ll briefly look at Apple’s Pages application, which comes bundled with its iWork ‘08 suite. Apple really improved their AppleScript support in this latest iteration of Pages.

When you want to manipulate a Pages document, you should get the document class of your document:

set doc to document 1

You can now tell doc to change the properties and elements of your document. One of the main properties of the document class is body text. Body text is the main flow of your text document. If you extract data from your database and copy that data to the clipboard, you use AppleScript to paste that data to the body text of your Pages document.

set body text of doc to the clipboard

A Pages document is also comprised of pages, sections, and paragraphs, which you can access through AppleScript.

Because Pages also acts as a page layout application, you can create and access text boxes, shapes, graphics, and images.

We’ll look at Pages more as we go forward, but you should know that Pages has an excellent AppleScript dictionary and can be used in your workflows.

Posted on 7 July 2008 at 14:06

Permalink to the post entryHelp Request: Table of Authorities

Dear readers, I’m writing a script that generates a Table of Authorities from a Pages document and I need your help. I’ve determined 2 ways to delimit a citation for inclusion in the Table and I’m interested in your thoughts on how to implement this all-important feature.

First, the user could highlight the citation, then select the type of citation (case or statute) from a dialog box. Microsoft Word for Windows uses this method. I don’t particularly like this method, but it’s familiar to many switchers.

The second way is to delimit the citations using a markup language. For example, one might use something like \case{A v. B., 123 U.S. 456 (2008)} within their text to delimit the case citation. With my background in LaTeX and HTML, I prefer this method as it’s easier to parse the document. Moreover, the user would not have to go back and highlight each citation, hoping not to miss a citation. Instead, the user would simply delimit the cases as he or she types.

Here’s a quick movie of what I have so far. I’d love to get your feedback on how you might delimit the citations. Thanks!