The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   How does Applescript recognize grouped images in Omnigraffle? (http://forums.omnigroup.com/showthread.php?t=13214)

Daria 2009-07-27 04:54 AM

How does Applescript recognize grouped images in Omnigraffle?
 
I want to write a script selecting each group in each layer of each canvas of a given Omnigraffle file, but I'm not sure how Applescript recognizes grouped images or how the groups are ordered/indexed in the file. Any suggestions on how to do this would be greatly appreciated.

Charles Turner 2009-07-30 11:02 AM

Did you figure this out? You can do this:

[CODE]tell application "OmniGraffle Professional 5"
every group of every layer of every canvas of every document
end tell[/CODE]

But in practice you'll want to select certain documents. Run "every document" by itself, and you'll get a bunch of behind-the-scenes documents that Omnigraffle uses.

As far as order is concerned, a group contains a link to its canvas, so you could query its container hierarchy like so:

"canvas of every group of every layer of every canvas of every document"

More generally, I'd guess that item order (ie first, second, third) in Applescript lists correspond to Omnigraffle front-to-back order, and not the sequence in which they were created. This appears to be the case with layers (where layer titled "Layer 1" could actually be "item 2 of layers" in Applescript), but I haven't examined it thoroughly.

HTH, Charles

Daria 2009-08-18 08:36 AM

Sorry for the late response. Thanks very much, Charles!


All times are GMT -8. The time now is 12:27 PM.

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