View Single Post
The following is a reduced illustrative example. It's a hierarchy of bar graphs. Note that the narrower bars must come in front of the wider ones, and that the bars must come in front of the guide lines (the widest bar is that very short one rising slightly above the baseline, almost completely hidden by the two big intermediate ones). In the script fragment, it is written last of all the bars, right before the guidelines are drawn. If you copy the script fragment to the clipboard, you can see the graph with “pbaste | osascript” in Terminal.
Code:
tell application id "com.omnigroup.OmniGrafflePro"
activate
close front window
make new document with properties {template: "Blank"}
tell canvas of front window
make new shape at end of graphics with properties {fill: solid fill, fill color: {1, 1, 1, 1}, draws shadow: false, size: {46.7027027027027024, 4.87735578}, origin: {326.91891891891892, 211.12264422}}
make new shape at end of graphics with properties {fill: solid fill, fill color: {1, 1, 1, 1}, draws shadow: false, size: {46.7027027027027032, 60.1554228}, origin: {256.864864864864865, 216}}
make new shape at end of graphics with properties {fill: solid fill, fill color: {1, 1, 1, 1}, draws shadow: false, size: {46.7027027027027026, 13.7178294}, origin: {163.45945945945946, 216}}
make new shape at end of graphics with properties {fill: solid fill, fill color: {1, 1, 1, 1}, draws shadow: false, size: {46.7027027027027028, 66.0924}, origin: {93.4054054054054056, 216}}
make new shape at end of graphics with properties {fill: solid fill, fill color: {1, 1, 1, 1}, draws shadow: false, size: {140.108108108108108, 82.003416}, origin: {245.18918918918919, 133.996584}}
make new shape at end of graphics with properties {fill: solid fill, fill color: {1, 1, 1, 1}, draws shadow: false, size: {140.108108108108108, 80.149344}, origin: {81.7297297297297299, 135.850656}}
make new shape at end of graphics with properties {fill: solid fill, fill color: {1, 1, 1, 1}, draws shadow: false, size: {326.91891891891892, 2.52162636}, origin: {70.0540540540540542, 213.47837364}}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 216}, {432.000000000000001, 216}}, tail scale: 0.5, head scale: 0.5}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 414}, {35.0270270270270271, 18}}, tail scale: 0.5, head scale: 0.5}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 414}, {432.000000000000001, 414}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "***", size: 14, alignment: right, font: "Helvetica", text: "***"}, origin: {10.6756756756756757, 411}, vertical padding: 0}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 348}, {432.000000000000001, 348}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "**", size: 14, alignment: right, font: "Helvetica", text: "**"}, origin: {10.6756756756756757, 345}, vertical padding: 0}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 301.86798}, {432.000000000000001, 301.86798}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "*", size: 14, alignment: right, font: "Helvetica", text: "*"}, origin: {10.6756756756756757, 298.86798}, vertical padding: 0}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 282}, {432.000000000000001, 282}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "*", size: 14, alignment: right, font: "Helvetica", text: "*"}, origin: {10.6756756756756757, 279}, vertical padding: 0}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 150}, {432.000000000000001, 150}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "*", size: 14, alignment: right, font: "Helvetica", text: "*"}, origin: {10.6756756756756757, 147}, vertical padding: 0}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 130.13202}, {432.000000000000001, 130.13202}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "*", size: 14, alignment: right, font: "Helvetica", text: "*"}, origin: {10.6756756756756757, 127.13202}, vertical padding: 0}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 84}, {432.000000000000001, 84}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "**", size: 14, alignment: right, font: "Helvetica", text: "**"}, origin: {10.6756756756756757, 81}, vertical padding: 0}
make new line at end of graphics with properties {point list: {{35.0270270270270271, 18}, {432.000000000000001, 18}}, tail scale: 0.5, head scale: 0.5, stroke pattern: 18}
make new shape at end of graphics with properties {side padding: 0, fill: no fill, draws stroke: false, draws shadow: false, autosizing: clip, size: {20, 10}, text: {text: "***", size: 14, alignment: right, font: "Helvetica", text: "***"}, origin: {10.6756756756756757, 15}, vertical padding: 0}
end tell
end tell

Last edited by gshenaut; 2013-02-27 at 02:57 PM..