I can't figure out how to translate the following AppleScript into JXA (JavaScript for Automation under Mac OS X Yosemite) :
tell application id "com.omnigroup.OmniGraffle6"
tell canvas of front window
make new line at end of graphics with properties {point list:L, draws shadow:false}
end tell
end tell
Here is what I've tried but this fails while executing the last line with error "AppleEvent handler failed" :
app = Application('OmniGraffle')
pt1 = app.Point({x:1,y:2})
pt2 = app.Point({x:1,y:2})
L = []
L.push(pt1)
L.push(pt2)
line = app.Line({pointList:L})
app.documents[0].canvases[0].lines.push(line)
Can anyone help ?
Thanks, Aurelien