Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

exportFile results in 'undefined' in Illustrator CC 2014

$
0
0

Hello-

 

I am creating a script to help version my files. the intended goal is to export the active document to a child directory as a PNG.  I have followed the CC 2014 scripting examples but the 'exportFile' method is returning undefined.   Also in the Object viewer that method is not returned on search.  I am trying to ascertain  if that method has been deprecated in this latest release.  I do not have experience with prior versions of Illustrator so I am not aware if how this functioned in past.

 

Has anyone had success with this method in CC 2014?  Any Clarity lent would be appreciated.

 

Brian in NYC

 

var watchfolder = "/watchFolder";

 

exportPNGWithTimestamp (watchfolder);

 

function exportPNGWithTimestamp (watchfolder){

var date = new Date;

var month = date.getMonth() +1; //for zero index

var day = date.getDate();

var time = date.toLocaleTimeString();

var type = ExportType.PNG24;

var fileSpec= new File(watchfolder + "/" + app.activeDocument.name + "_" + month + "_" + day + "_" + time + ".png");

app.activeDocument.exportFile (fileSpec, type);  

    }


Viewing all articles
Browse latest Browse all 12845