Omnigraffle Table of Contents Generator

You’re reading an article in the Fuzzy Math design series. These articles talk about our practice: why we do what we do, and how we do it.

I was going to write up a lovely exposition on the benefits of using this table of contents script, honest! But then, life happened. In the meantime, this script sat and got no better while left to its own devices. And someone else had the same idea for this script!

The script from Unitid gives you a lovely set of results, with all sorts of concerns about typography and layout. This is why I love the Dutch ethos so much! Mine… well, it leaves such things to your own devices for simplicity’s sake. It’s an easy thing to use. To wit:

1. Start with an Omnigraffle file with a canvas named “Table of Contents” and a layer named “TOC.”

2. Double click on the Applescript.

3. Format away on my ugly buttons to your heart”s content.

You have two options with the formatting option 1 is tricky. You can simply edit the script. Here’s the main line:

The big thing to know here is that you want to insert the tempName value and the calculations for the placement of the new shape. If I

In Omnigraffle if you pick any object you can then copy it using Edit » Copy As » Applescript. Now, paste that into the Applescript file where the above code is and you’re almost done. You want to insert the tempName value and the calculations for the placement of the new shape as in the green text above (canvasNumber and the values before it, and tempName). If I’m not describing it well, don’t sweat it. There’s an easier way I’ll show you in a minute, too. Otherwise, knowing that you can copy’n’paste stuff from Omnigraffle straight into Applescript is a mind-blower. At least, to this guy.

The easier way is by using Omnigraffle itself. So here goes:

1. Go to the Table of Content canvas in your document.

2. Hit Command – 3 and peep on this palette:

A screenshot of the Omnigraffle canvas selection pane

3. Select all my ugly buttons, by clicking on their representation here, then move them about the page as you will.

Yay, you’re done! Next up will be a script to auto-generate a sitemap in Omnigraffle from a Google sitemap file.

Omnigraffle icon

Here is a zip with an example Omnigraffle file and the Applescript for you to use.

Want more content like this?

Stay up to date on all things UX with our monthly newsletter.

Filed Under:

envelope mail-envelope-closed file_pdf arrow-up chevron-left arrow-left close x linkedin twitter facebook mailbox search