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: https://www.youtube.com/watch?v=NetQNRVBwOA
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"
	
	arguments.push(pdfImport);
	arguments.push("-PDF_SUPPORT_CMYK");
	arguments.push("-PDF_SEPARATE_LAYERS");
	
	var folderPos = filename.findRev("/");

	if (folderPos != -1){
		var folder = filename.left(folderPos);
		System.println("folder = " + folder);
		
		if (!folder.isEmpty()){
			arguments.push("-outdir");
			arguments.push(folder);
		}
	}
	
	arguments.push(filename);
	
	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!!
=Z

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:
http://forums.toonboom.com/toon-boom-animate-family/support-and-troubleshooting/how-run-script-where-script-editor

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.

http://docs.toonboom.com/help/harmony-12/premium-network/Content/_CORE/Workflow/025_Import/012_H1_Importing_AI_and_PDF_Files.html

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?