Yow! I was going to write up a lovely exposition on the benefits of using this table of contents script, honest! But then, personal stuff happened for me in a big way. For the backstory on that, you can go check out my recently maudlin blog. In the mean time, 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:
In Omnigraffle if you pick any object you can then copy it using Edit » Copy As » Applescript. Now, past 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:
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.
![]()
Here is a zip with an example Omnigraffle file and the Applescript for you to use.
Popularity: 18% [?]


Hi Jason! So we had the same frustration. Omnigraffle is a great program, but is missing a few features important to some of us.
Tried out your script, indeed similar to our approach. I didn’t know about the “copy to applescript” feature, very useful. I think about adding it to our code. Thanks!
Great minds think alike, no? I must say your work is more beautiful than mine, though. I particularly like how you have the page numbers in your table of contents, that is a real benefit. I finished the scripting part, got too impatient and released it.
I just posted another script, this one allows you to generate an Omnigraffle file with a sitemap from a sitemap.xml. Maybe you will find this one useful as well?
Go Orange!
I got the sitemap script running! I’ll be back next week for new scripts :)