Friday, April 21, 2006

Go get XPress - Part 1

I introduced "Wild CAT" corpus accessory (guess I forgot to mention the name) in the last post. In the next few posts, I would like to look into a little more detail about the scripts with which the accessory talks to an application.

Here I got QuarkXPress as the target application. Oh, by the way, I am not an AppleScript guru at all. In fact, I am writing this with Bert Altenburg’s AppleScript for Absolute Starters as a reference. So please don't pick nits.

The first function is getContents() which, by definition, "returns whole contents of the text container with focus". What we do is to get the whole text in the current story. Here is a sample code for QuarkXPress:

on getContents()
  tell application "QuarkXPress"
    return story 1 of current box
  end tell
end getContents

You cannot make it any simpler than that?

0 Comments:

Post a Comment

<< Home