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 General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Using AppleScript to set the Script field of a shape Thread Tools Search this Thread Display Modes
I'm using OmniGraffle 2.2 and it does almost everything I need from within AppleScript except for one thing. If that one things exists in the most recent version of OmniGraffle then it will be worth it for me to upgrade. However, since I don't have the current version to search for the answer, I wonder if someone here can tell me if it is possible.

From within an AppleScript script, I would like to be able to set the script field of a shape. Is this possible? Here is an example code fragment:

set aShape to make new shape at end of graphics with properties {fill color:{51657, 52942, 65535}, origin:{28, 450}, size:{28, 500}, draws shadow:false, thickness:1, draws stroke:true, script:"myscript"}

except that "myscript" would contain the AppleScript code that would get executed when this shape is selected while in Browse mode.

This function does not appear to work in version 2.2

Thanks,

Mike
 
You can certainly do that in the current version. The capability has been there for quite a while.

Your example with a real script in it works as expected in 5.3:

Code:
tell application "OmniGraffle Professional 5"
	tell canvas of front window
		set aShape to make new shape at end of graphics with properties {fill color:{51657, 52942, 65535}, origin:{28, 450}, size:{28, 500}, draws shadow:false, thickness:1, draws stroke:true, script:"set the text of self to \"foo\""}
	end tell
end tell

Last edited by john.gersh; 2011-07-27 at 04:56 AM..
 
Thanks for the reply. Now I get to try the App Store for the first time!

Mike
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stencil: Custom circles of arrows (Shape with script Action) RobTrew OmniGraffle Extras 1 2013-07-29 07:28 PM
Applescript: which shape properties can be set via a dictionary? Sophie OmniGraffle General 4 2012-11-23 08:17 AM
Applescript: set multiple shape properties in 1 call? Sophie OmniGraffle General 5 2012-11-18 06:30 AM
Feature request : Field.Onchange >> trigger script jdbtst OmniOutliner 3 for Mac 0 2009-12-07 02:13 AM
AppleScript: Updating the text of a shape without affecting the formatting jschel OmniGraffle General 0 2008-08-12 03:05 AM


All times are GMT -8. The time now is 10:02 PM.


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