The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Applescript in OG6: Can no longer get graphics of a group Thread Tools Search this Thread Display Modes
I can find no way to get graphics of a group in OG6.

Here's the code that works in OG5, with a group of three circles selected:

on run
tell application id "OGfl"
set sel to selection of front window
set g to item 1 of sel
display dialog class of g -- displays "OGGR"
set glist to graphics of g
end tell
end run

In OG5, glist is set to a list of the group's graphics:

{graphic id 40446 of canvas id 1 of document "graphics test.graffle" of application "OmniGraffle Professional 5", graphic id 40447 of canvas id 1 of document "graphics test.graffle" of application "OmniGraffle Professional 5", graphic id 40448 of canvas id 1 of document "graphics test.graffle" of application "OmniGraffle Professional 5"}

in OG6, the "set glist" line returns this error:

Can’t get every graphic of graphic id 40350 of canvas id 1 of document \"graphics test\"." number -1728 from every graphic of graphic id 40350 of canvas id 1 of document "graphics test"

And if I say the following (which also works in OG5):

set glist to (graphics of g) as list

I get, humorously, a one-item list containing a list reference - very meta:

{every graphic of graphic id 40350 of canvas id 1 of document "graphics test" of application "OmniGraffle"}

Note, however, that getting the graphics of a canvas works fine. I didn't test getting the graphics of a layer (though shared layers still return invalid graphic references)

I wish you would have beta tested before releasing. You should put OG5 back up on your site, and give anyone that buys the full version of OG6 a free license for OG5, at least until it's all of the bugs are worked out.
 
Yes, the OG 6 Applescript library still states that:

Code:
The graphic class is used in the following ways:
element of canvas class
element of column class
element of group class
element of layer class
element of row class
element of shared layer class
element of subgraph class
element of table class
element of table slice class
but in fact the implementation of .graphics for the group class seems to be one of the things that have fallen through the net.

(Judging by the number of scripts that are breaking, there are probably a number of other such issues to be discovered and fixed.

Upgrading to Graffle Pro Ver 6 can't be recommended yet if you need to use scripts. Even unbroken scripts are running unusably slowly).
 
Quote:
Originally Posted by RobTrew View Post
Even unbroken scripts are running unusably slowly
This remains true of the shipped 6.0, but has been fixed in test builds after 6.01 r196000, so the future is looking better, in terms of speed, at least.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -8. The time now is 07:43 PM.


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