Tell me more ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.
activeDocument.fitArtboardToSelectedArt()

When calling this command, AI crashes on AI 5.1/6 32bit and 64bit versions. I can use the command form the menu. Has anyone encountered this? does anyone know of a work around?

The full code.

    function exportFileToJPEG (dest) {
    if ( app.documents.length > 0 ) {

        activeDocument.selectObjectsOnActiveArtboard()
        activeDocument.fitArtboardToSelectedArt()
        activeDocument.rearrangeArtboards()

        var exportOptions = new ExportOptionsJPEG();
        var type = ExportType.JPEG;
        var fileSpec = new File(dest);
        exportOptions.antiAliasing = true;
        exportOptions.qualitySetting = 70;
        app.activeDocument.exportFile( fileSpec, type, exportOptions );
    }
}
var file_name = 'some eps file.eps'
var eps_file = File(file_name)


var fileRef = eps_file;



if (fileRef != null) {
    var optRef = new OpenOptions();
    optRef.updateLegacyText = true;
    var docRef = open(fileRef, DocumentColorSpace.RGB, optRef);
}

exportFileToJPEG ("output_file.jpg")
share|improve this question
1  

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.