Scripting Apple Pages 5.2 using ASObjC

As I’ve mentioned recently, I’m in the process of converting an AppleScript Studio application that that we use in our office to ASObjC. I am currently work with Shane Stanley’s excellent book, and once I feel comfortable with ASObjC I will tackle this project.

The AppleScript Studio application works with Apple Pages 4.3. As we all know, until version 5.2, Apple did not support AppleScript with Pages 5.x. Consequently, I just resigned myself to the idea that everyone in our office was going to have to continue using the older Pages.

However, I’m excited to see that Apple is now supporting AppleScript in Pages starting with version 5.2, but my understanding is that it’s not as robust as it was previously. Hopefully this is temporary (or better yet, maybe I am misinformed and Applescript support on version 5.2 is great). In the mean time, I would appreciate some advice. In a nutshell, this is all the Pages scripting I need at this time:

I open a template.
I insert a couple of text boxes.
I enter some formatted text into these text boxes (using styles).
I then jump down below the text boxes, set the insertion point, and start entering formatted text (using styles).

I believe I can work out the syntax, if this functionality is available in Pages 5.2.

Can anyone see any reason why the new Pages (version 5.2 or beyond) wouldn’t be able to do this with Applescript?

Thanks in advance.


You should be able to use the Pages AppleScript dictionary to see what functionality is available. To open an AppleScript dictionary, you first launch AppleScript Editor and then choose File > Open Dictionary…

Here is a post concerning interpreting the dictionary: