-
Import Adobe Illustrator .ai file and place it on a active comp as a layer with Extendscript
Hi all,
I have a problem getting started with a script that allow me to import a illustrator file (with dialog import window, command-i), place it on the active composition as a new layer, convert it to a shapelayer, add layer style (stroke, stroke color, stroke size, stroke position) and add trim path keyframes.
This is my starting code:
var myComp = app.project.activeItem; //active comp
var myFile = app.project.importFileWithDialog(); //import illustrator file
var myLayer = myComp.layers.add(myFile); //add to active comp as new layer
I get a error “After Effects error: Unable to call “add” because of parameter 1. Array is not of the correct type.”

Hope someone can get me started, what am I doing wrong?
Greetz,
Dennis.