If I create an OmniGraffle document, add a text box with “Test” in red in size 28, I can change the text with this snippet of AppleScript:
tell application "OmniGraffle Professional 4" set text of first solid of first canvas of first document to "Hello" end tell
But this will also change the color, font size and other styling attributes to some defaults. I have an old AppleScript script which did something like the one below to change the text without changing the styling attributes by setting the “text” property of the “text” of the “solid”. The AppleScript dictionary of OmniGraffle Pro says that the “text” property of a “text” is the “The actual text content.”
tell application "OmniGraffle Professional 4" set text of text of first solid of first canvas of first document to "Hello" end tell
I am sure this used to work, but I've gone through a few OS X upgrades and OmniGraffle updates since last running that script, and when I try it now, I get an error. (I am still using OmniGraffle Pro 4 though, not the new OmniGraffle Pro 5)
Is there some other way to change just the text without changing the styling attributes or a workaround for the above error (which I suspect to be a bug)? Does it work in OmniGraffle Pro 5?