The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Using Omnigraffle for interactive prototypes - need Applescript help Thread Tools Search this Thread Display Modes
Applescript isn't very well documented in OG and I'm having difficulty with some basic issues. The first issue, is how to address a graphic object.

The script below is supposed to modify a graphic object with the tag 'object_1' but it doesn't appear to work.

tell application "OmniGraffle Professional 5"
	tell canvas of front document 
		set targetGraphic to first graphic whose tag contains "object_1" 
		set text of targetGraphic to {text:"differenttext", color:{1.0, 1.0, 1.0}, alignment:center}
	end tell 
end tell
More broadly, the things I'm trying to do are:
  • Simulate typing into a text box
  • Animate a dialog appearing/disappearing
  • Animate an object after clicking on a different object (slider control)
  • Fade graphics in and out

To do all this, my first hurdle is simply addressing objects

A few issues:

you're specifying a color for the text which will be invisible unless you've set the background color to something else

while it may seem like first graphic whose tag is "xyz" ought to give you a single item, it gives you a list of length 1. If you take the first item from the list, you should be able to manipulate it as you want. You'll also want to watch out for graphics whose class is not shape; groups in particular won't allow you to set their text.

Script Debugger is a big help when trying to puzzle this stuff out.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
More Interactive Features! abeman21 OmniGraffle General 1 2011-04-13 12:18 AM
AppleScript-Omnigraffle Documentation? Daria OmniGraffle General 2 2009-07-22 11:18 AM
Interactive Export williamo OmniGraffle General 3 2009-06-21 06:45 PM
Can I name an OmniGraffle window in AppleScript? ianpiper OmniGraffle General 0 2008-07-30 06:36 AM
Interactive Elements on Stencils (Applescript) ChristianS OmniGraffle Extras 3 2007-06-21 05:43 PM

All times are GMT -8. The time now is 01:25 PM.

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