View Single Post
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


Thanks,