Applescript in OG6: Can no longer get graphics of a group
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 [B]element of group class[/B] 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[/CODE] but in fact the implementation of [B].graphics[/B] for the [B]group[/B] 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=RobTrew;127647]Even unbroken scripts are running unusably slowly[/QUOTE]
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. |
All times are GMT -8. The time now is 01:27 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.