The app is offering the same object in Multiple Suites?

I’m up way too late trying to crack this. Unfortunately I’m too tired to read everything to find the info I’m looking for. I’m going to ask my question then go to sleep.

I’m trying to do some scripting with OmniGraffle. It has a Text Suite and an Extended Text Suite. My problem is that I’m replacing the text in my document with new text, and it’s changing the alignment on me from right justified to left. However, I can’t access the “alignment of text of …” property that is listed in the Extended Text Suite. I only seem to be able to access the color, font and size properties that are the only ones listed in the Text Suite.

I’m sure I could have been asleep hours ago if I could figure this out. I should be able to access “text of text of solid …” in theory and just change the text and none of the formatting. I’m slowly going crazy! Wait, no, I went slowly crazy and now the questions is just if I’m still going crazy or if I’ve arrived. Help!?

  • Chris

Ahh. I’ve figured out something new. (hopefully this will also help other noobs)

Here’s what I’ve learned. I’m closer to a solution but not quite there yet. It looks like I was really asking the wrong question. The reason I couldn’t find the answer about how to select which “Suite” I was dealing with is because there is no way in this particular context. (I could deal with suites from other applications by using a tell )

What I was trying to do what this:

tell application "OmniGraffle"
   set thisPage to front page of document "myDoc.graffle" of application "OmniGraffle"
   set myShape to solid id 164 of thisPage

   set text of myShape to "this is some text"
   set font of text of myShape to myFont --imagine I set up this variable previously (invisible lines of code right)
   set alignment of text of myShape to myAlignment -- I set this one up in another invisible line

   -- this won't work because I can't get "alignment of text of myShape", even though text of myShape should in theory have alignment AND font
   -- (see dictionary snippet below)
end tell

BUT there is another way to deal with properties!

tell application "OmniGraffle"
   -- import first few lines of previous example here
   set properties of myShape to {text: {alignment: right, font: myFont, text: "some text"}}
end tell

Here is my problem now:
What I really want to do is change the property of the shape (example 1 = {text: {text: “my text”}}) without chaning any of the other properties, because I set those up when I created the OmniGraffle document. But if I do just that (see example 1) then I end up with a text property that only has it’s text property set, the rest are wiped out to defaults. So if I have a shape with these properties (for example):

myShape properties {text: {text: "my text", alignment: "center", font: "Arial", size: 24}}

How do I touch only the property {text: {text:}} without changing any others?

This is a much better question, no? (amazing how after a bit of sleep learning becomes fun again!)

Looks like you could use some concatenation magic, Chris. :wink:

I don’t normally use OmniGraffle, so I can’t check if this works within an OG tell block, as it does here - although I’d generally expect it to:

set myShape to {text:{text:"my text", alignment:"center", font:"Arial", size:24}} (* normally set previously *)

set myShape to {text:{text:"replaced text here"} & item 1 of myShape's records}

--> {text:{text:"replaced text here", alignment:"center", font:"Arial", size:24}}

I started a new thread with what I thought was a somewhat different question to help me solve my problem, but it looks like the answer to the questions in this thread will be covered over there: Go there :wink:

(hmm, I’ll have to learn how to make prettier links and come back and fix that…)

Browser: Firefox 1.0.3
Operating System: Mac OS X (10.4)

You might want to check out these notes on bbcode. :slight_smile:

Hey! that’s just what I was looking for and couldn’t find.
I would expect to see a “Help” item in the “toolbar” or a link to it somewhere from the posting page.
I only see “MacScripter Applescript Forums Rules Posting Guidelines User list Search Profile Messges Logout”

Where is that help hiding anyway?

Just beneath the entry box where you type in your messages, there are some notes that look something like this:


BBCode: on [img] tag: off Smilies: on

Just click on the blue text links and you’re away. (Help pages should open in a new window). :slight_smile:

I solemnly declare that: confusing.

If the creator of this BB ever decides to peer down into this lowly message, that person might want to consider that when one is interested in help, one usually looks for the word: “Help”. And when you have a “Link: on”, one is somewhat likely to asume that clicking the link changes that item to “off”.

I would even go so far as to suggest that person might change it to be something like this:
Click here for help about: BBCode Smilies

(notice that [img] tag is not even there because it’s turned off)

:wink:

What for?