Place SVG in Illustrator

I am trying to place svg in Illustrator using extendscript. That’s basically what I do

var doc = app.documents.add();
var p = doc.placedItems.add();
p.file = new File(svgfilepath);

This does not fail

The file is in a format that cannot be placed

I can place the same file manually using File> Place. Am I missing something? Help is needed!

+4
source share
1 answer

By W_J_T on forums.adobe.com:

var doc = app.activeDocument;  
var svgFile = File(Folder.desktop + '/testSVG.svg');  
doc.groupItems.createFromFile(svgFile);  

It works!

+3
source

All Articles