Skip to main content
Inspiring
November 26, 2022
Answered

Is it possible to place .svg file with script inside Illustrator?

  • November 26, 2022
  • 1 reply
  • 1804 views

Is it possible to place .svg file with script inside Illustrator?

Using .. docR.placedItems.add()...

 

I am getting error message "'The file "FileName.svg" is in a format which cannot be placed'".

Correct answer livl17017666

I have found on the forum and stackoverflow this solution:

https://community.adobe.com/t5/illustrator-discussions/svg-files-into-one-layered-ai-file/m-p/4733761

https://stackoverflow.com/questions/28839109/place-svg-in-illustrator

 

var svgFile = File.openDialog("Select File to place...");

var doc = app.activeDocument;

doc. groupItems.createFromFile( svgFile );

 

If someone has something else to add welcome?

 

1 reply

livl17017666AuthorCorrect answer
Inspiring
November 26, 2022

I have found on the forum and stackoverflow this solution:

https://community.adobe.com/t5/illustrator-discussions/svg-files-into-one-layered-ai-file/m-p/4733761

https://stackoverflow.com/questions/28839109/place-svg-in-illustrator

 

var svgFile = File.openDialog("Select File to place...");

var doc = app.activeDocument;

doc. groupItems.createFromFile( svgFile );

 

If someone has something else to add welcome?

 

m1b
Community Expert
Community Expert
November 26, 2022

Hi @livl17017666, no you've found the answer. Illustrator doesn't seem to let us place SVGs as links. You could check out my answer here for an unusual use case, but what you've got is basically the whole answer.

- Mark