Setting Jump targets via AppleScript
Joshua Dickens <[email protected]>
| Newsgroups | gmane.comp.graphics.omnigraffle.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I am trying to use AppleScript to create a Table of Contents page for
my OG documents.
I think conceptually I've got a pretty good idea of how to do it; loop
through all the canvases, create a shape whose text is the canvas
title + page number, and then, I'd like to create a jump target to
that particular canvas.
The problem is, setting a jump target via applescript doesn't seem to
work -- when the text is created the inspector still says "Do
nothing", and using the action browse tool doesn't indicate any
clickability. In fact, if I copy the item again via applescript, it
doesn't show the properties.
Is this a known issue? is there a workaround?
Here's my simple code, FWIW:
tell application "OmniGraffle Professional 5"
set theHeight to 14.0
set theCanvases to every canvas of the first document
tell canvas of front window
repeat with theCanvas in theCanvases
set theTitle to the name of theCanvas
set thePage to ((the id of theCanvas))
make new shape at end of graphics with properties {fill:no fill,
draws shadow:false, jump:theCanvas, size:{86.0, theHeight}, side
padding:0, autosizing:full, vertical padding:0, origin:{140.0, 175.0 +
theHeight * thePage}, text:{text:theTitle, alignment:center}, draws
stroke:false}
make new shape at end of graphics with properties {fill:no fill,
draws shadow:false, jump:theCanvas, size:{43.0, 14.0}, side padding:0,
autosizing:full, vertical padding:0, origin:{85.0, 175.0 + theHeight *
thePage}, text:{text:thePage as string, alignment:center}, draws
stroke:false}
end repeat
end tell
end tell