The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   Applescript action not working in presentation view (http://forums.omnigroup.com/showthread.php?t=10992)

Blake 2009-01-07 09:46 PM

Applescript action not working in presentation view
 
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?

Joel 2009-01-15 09:24 PM

Likely a known issue with respect to AppleScript and Presentation Mode, we added actions in the Action Inspector to hide and show layers in version 5 to workaround this situation, so going that route would be my advice.

Blake 2009-01-15 10:10 PM

Normally I do use the hide/show layers action in the Action Inspector. However, in this case I need to hide a layer AND jump to a different canvas. Seems like the only way that I can do both of them is to use an AppleScript in the action. And then I run into the problem with the script working fine except in presentation mode. Any chance this issue will get fixed sometime soon?

Alternately, if the Action Inspector would let me hide/show layers AND jump to a specific canvas, then I could definitely avoid the applescript. Any chance of adding that functionality sometime soon?

Joel 2009-01-16 07:01 AM

Well, I've filed a bug against this particular problem, we also have a request to run multiple actions on a shape at one time, which may also facilitate this.


All times are GMT -8. The time now is 08:30 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.