Import separate layers from AI - BROKEN

I’m trying to import an illustrator file, keeping the separate layers using the latest version of Harmony Stage.

I am getting an error,
“Script does not evaluate : line 8”

Referencing this video:
And this code:

function importIllustrator(){
var filename = FileDialog.getOpenFileName( “.ai;.pdf” );

if (filename) {
	System.println("importing " + filename);
	var arguments = new Array;
	var pdfImport = Application.specialFolders.bin + "/Pdfimport"
	var folderPos = filename.findRev("/");

	if (folderPos != -1){
		var folder = filename.left(folderPos);
		System.println("folder = " + folder);
		if (!folder.isEmpty()){
	var ret = Process.execute(arguments, "");
	System.println("returned " + ret);


Please help soon! Otherwise I’ll need to be using After Effects for this project, which would be a bummer!!

I posted this under another topic but I thought I’d add it here too:

Hate to tell you this but that script no longer works :frowning:

A few of us here in the forums have posted about getting it fixed but so far no go. It hasn’t worked since the Animate Pro3/Harmony 10 upgrade unfortunately.

Harmony 11 when you import Illustrator files through the library, they come in as separate layers so there’s no need for the script anymore.

Read and try this instead:

Remember to save as Illustrator CS or CS2!

I’m using Illustrator CS6
Toon boom harmony 12

My files doesn’t have spaces, accented and special characters in the filename. I’m following exactly what is saying here.

But i’m stuck up in the third step!! My dialog box to rename my file doesn’t appeared like is saying because after importing nothing else happened.

  • First step OK
  • Second step . File > Import > SWF, Illustrator files to library. OK / Right- click on any unlocked folder and select IMPORT FILES
    ( I did right-click on stage library and choose my file but then nothing happened)

Am I doing something wrong?