View Single Post
I'm doing a little project with OmniGraffle, and I've gotten to the point that I think some AppleScript would be just the thing to make my life easier. (I've had "Learn AppleScript" on my Someday/Maybe list for a while now.)

I'm making a map of my school district and plan to use small squares to mark the locations of our elementary, junior high and high schools. Each of those three groups will have a different color, and the school graphics reside in three separate layers corresponding to elementary, jr. high, and high school. I've created some user data for each square graphic with a key "name" and value set to the abbreviation we use for that school (e.g., "mgsh").

Let's say I wanted to create an AppleScript that would look in the current document for a graphic element with user data: {name: "mgsh"} and set its fill color to blue.

Can I access that graphic element by name directly, or do I need to loop through all the objects in a given layer and look for it sequentially?

Any pointers would be greatly appreciated.

(Proud OmniFan)