File disappearing after export

Post Reply
ERodgers
Newbie
Posts: 6
Joined: Fri Feb 17, 2017 7:17 pm

File disappearing after export

Post by ERodgers »

Hey everyone, something strange is going on after I export a file through an Illustrator script. We have a script that takes an Illustrator file and exports it as a tiff. It exports, but once it goes into the folder, it just disappears. Has anyone experienced this? Here is the portion of my script that does the exporting:

Code: Select all

var aiDocument = app.activeDocument;
var wholeName = aiDocument.name;
var extractedName = wholeName.substr(0, wholeName.lastIndexOf("."));
// other parts of the code not relevant
var outputPath = $outfolder + "/" + extractedName + ".tif";
exportFileToPSD(outputPath);

$outfiles = Array();
$outfiles.push(outputPath);
$jobfolder = "";
aiDocument = null;

function exportFileToPSD (dest) {
    if(app.documents.length > 0) {
        var exportOptions = new ExportOptionsTIFF();
        var type = ExportType.TIFF;
        var fileSpec = new File(dest);
        exportOptions.resolution = 150;
        exportOptions.saveMultipleArtboards = true;
        app.activeDocument.exportFile( fileSpec , type , exportOptions );
    }
};
ERodgers
Newbie
Posts: 6
Joined: Fri Feb 17, 2017 7:17 pm

Re: File disappearing after export

Post by ERodgers »

I managed to solve this. For some reason using the $outfolder variable sends the .tiff to a random temp folder in the Switch Server folder, after which it just hangs out. I made a folder on the desktop and then had a folder in the flow mapped to that folder, hardcoded the path instead of using the $outfolder variable and that worked.
Post Reply