我正在尋找一種在Adobe Illustrator中使用JXA(JavaScript for Automation)創建路徑項的方法。我多次搜索了整個互聯網,找不到任何東西......蘋果開發人員網站上只介紹了JXA的基本信息:JavaScript for Automation Release Notes (10.10) Adobe根本沒有涉及到這個主題。 這裏是我的代碼,我就開始想一個橢圓添加到現有的文檔:通過JXA(JavaScript for Automation)在Adobe Illustrator中創建一個新路徑項目
illuApp = Application('Illustrator')
docPath = "/Users/userOne/Desktop/Document_One.ai"
illuApp.open(docPath)
currentDoc = illuApp.currentDocument
console.log(currentDoc.name())
// Ellipse constructor
newEllipse = illuApp.Ellipse({left: 512.5, top: 87.5, width: 425.0, height: 75.0, reversed: false, inscribed: true})
// This doesn't work **(Error -1700: Can't convert types.)**
currentDoc.pathItems.push(newEllipse)
任何幫助,將不勝感激,謝謝! :)
謝謝您的回覆。這聽起來相當清醒...也許6月9日帶來一些好消息:) – blauzahn