Je ne peux pas comprendre comment traduire la AppleScript suivante dans JXA (JavaScript pour l'automatisation sous Mac OS X Yosemite):JXA & OmniGraffle
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
Voici ce que j'ai essayé, mais cela ne fonctionne pas lors de l'exécution la dernière ligne avec l'erreur "Gestionnaire AppleEvent a échoué":
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)
Quelqu'un peut-il aider?
Merci, Aurelien