View Single Post
I am using MacRuby to script Omnigraffle Pro (infinitely easier and nicer than Applescript). I can easily get a handle on the app, document, canvas, etc. Now want to add / manipulate shapes on the canvas.

framework 'ScriptingBridge'

$omni = SBApplication.applicationWithBundleIdentifier("com .omnigroup.OmniGrafflePro")

$document = $omni.windows[0].document

$canvas = $omni.windows[0].canvas

$canvas.methods(true,true).sort

=> [:adjustsPages, :"assembleSubgraph:tableShape:", .... :verticalPages]

The AppleScript dictionary report:
make v : Make a new object.
make
new type : The class of the new object.
[at location specifier] : The location at which to insert the object.
[with data any] : The initial data for the object.
[with properties record] : The initial values for properties of the object.
→ specifier

And Omnigraffle "Copy as Applescript" suggests this:
tell application "OmniGraffle Professional"
tell canvas of front window
make new shape at end of graphics
with properties {size: {10,80}, origin: {9,9}}
end tell
end tell

I cannot find the "make new <type> ..." method on Canvas.

Questions:
- Where is this method?
- What other resources (e.g. Objective-C header files? Anything else?) can I use to find out about valid parameter values (e.g. is it a numeric code for "Shape"? "Rectangle"? How do I say "at <end of graphics>"?

Thanks!!