Export Variables Illustrator.

Export Variables Illustrator.

I’m new with apple script. But I want to develop some drawing tools in Illustrator CS. The problem is I cannot make the ‘export variables’ function to work. This simple script

tell application "Illustrator CS"
	set kleur to "Hiiiii"
	export variables kleur of document 1 to file "HD-XXL:proefvar.xml"
end tell

gives me all the time the error message:

“Adobe Illustrator CS got an error: File/Folder expected”

I tried all different file/path notations but it gives me always the same error.
Does anybody have some ideas or comments about this?

This is what the dictionary says:

export variables  document  -- the document object or objects to be operated upon
	to  file specification  -- file spec to export to

And this is what the Guide says about this topic:

document
The document object or objects to be operated on)
Objects supported: variables
Returns: nothing

to [file] file specification:
The file to export the variable library into, specified as a string containing the full file path or an alias. When using a string, precede the string with the term file.)

hello

I can’t help you with apple script but here is the javascript that performs the same task

// set the document reference
var docref = app.activeDocument;

// create a new document
var newFile = new File(“~/Desktop/sample.xml”);

//export it
docref.exportVariables(newFile);

if you can translate that into applescript you all set

Thank you for your reply! :smiley:

I almost had given up on this question.

I tried your script and it works fine. Thanks.

Strange (and a pitty) that apple script has problems with this function.

Do you have maybe a snipplet or example of how I can combine your exportVariables with making a dataset and how you can store/export it to the xml file because I’m not that familiar with Javascript.? :oops:

Thanks in advance.

regards,

MarcoP