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

Working with the Text of a Shape in OmniGraffle Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
I'm have trouble understanding how to work with text of an object.
I have made a sample and then copied as AppleScript.
I would like to break down the properties so that I can work with them.
I'd like to set the text and maybe even change the text of an existing shape.

Here is what the copied AppleScript looks like:

tell application "OmniGraffle Professional"
tell canvas of front window
make new shape at end of graphics with properties {name: "RoundRect", textSize: {0.800000, 1.000000}, user data: {myFirst: "1", myThird: "3", myforth: "4", mySecond: "2"}, fill: no fill, textPosition: {0.100000, 0.000000}, origin: {109.000000, 177.794006}, vertical padding: 0, size: {231.242004, 26.227800}, text: {text: "test", text: "test", alignment: center}, side padding: 0, draws shadow: false}
end tell
end tell

Below is the the modified AppleScript. As you can see I have commented out the text property because it didn't work.
I can only seem to set the text property when I create the shape.
I would really like to know how to work with the text of a shape.

tell application "OmniGraffle Professional 5"
tell canvas of front window
make new shape
set lastGraphicID to (get id of result)
tell graphic id lastGraphicID
make new user data item with properties {name:"myFirst", value:"1"}
make new user data item with properties {name:"mySecond", value:"2"}
make new user data item with properties {name:"myThird", value:"3"}
make new user data item with properties {name:"myforth", value:"4"}
set name to "RoundRect"
set textSize to {0.8, 1.0}
set fill to no fill
set textPosition to {0.1, 0.0}
set origin to {15.0, 204.397003}
set vertical padding to 0
set size to {231.242004, 26.2278}
--set text to {text: "test", text: "test", alignment: center}
set side padding to 0
set draws shadow to false
end tell
end tell
end tell


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating a shape in OmniGraffle ekin OmniGraffle General 4 2013-03-21 01:30 AM
When I click an shape why does it always think I want to edit the text? edgley OmniGraffle General 9 2012-04-24 01:20 PM
Shadow from text inside shape mlevin777 OmniGraffle General 4 2011-05-27 09:06 AM
Control shadow of Shape Text? Sophie OmniGraffle General 3 2010-05-06 01:52 PM
Text to shape conversion digimarkus OmniGraffle General 2 2009-10-14 12:26 PM

All times are GMT -8. The time now is 04:39 AM.

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