View Single Post
I'm using Omnigraffle Pro for some interface prototyping and when the user clicks on a particular object when running in presentation mode I'd like to hide a layer in the current canvas and then jump to a different canvas. I've got lots of actions that either hide/show some layers OR jump to a new canvas, but to do both at the same time it seems like an applescript is necessary.

I have tried a bunch of variations on a script like this:

tell application "OmniGraffle Professional 5"
tell canvas of front window
set visible of layer "My layer" to false
end tell
set canvas of front window to canvas "my other canvas" of document "my doc"
end tell

The script works perfectly when I click on the "Run Script" button in the action property editor. It also seems to work fine when I use the browse tool to click on the object (or when I run the script from the Script Editor). However if I click on it while in presentation mode, I get the following error:

OmniGraffle Professional 5 got an error: AppleEvent handler failed.

If I comment out the "set canvas of front window..." line, then it works, so that seems to be the line that doesn't work in presentation mode.

Any suggestions how to change the script to work from presentation mode or is this a known problem?