次の AppleScript を JXA (Mac OS X Yosemite でのオートメーション用 JavaScript) に変換する方法がわかりません。
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
これが私が試したことですが、これは最後の行を実行中に「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)
誰でも助けることができますか?
ありがとう、オーレリアン