• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script to save multiple artboards as separate eps files without using 'Use Artboards' option

New Here ,
Jul 04, 2024 Jul 04, 2024

Copy link to clipboard

Copied

Hello everyone!

I need a script for Illustrator to save multiple artboards as separate EPS files without using the 'Use Artboards' option. Sometimes I have more than 30 artboards with icons or logos, and as a stock contributor, I need to save them separately without using the 'Use Artboards' option. This would be a huge time-saver for me!

Thank you!

TOPICS
Scripting

Views

147

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Contributor ,
Jul 04, 2024 Jul 04, 2024

Copy link to clipboard

Copied

LATEST

 @Turan Ramazanli   check out this!

 

/**
 * @name SaveEPSScript
 * @version 1.0.0
 * @description Saves the active document as EPS in a new folder
  https://community.adobe.com/t5/illustrator-discussions/script-to-save-multiple-artboards-as-separate-eps-files-without-using-use-artboards-option/m-p/14718920#M412087
  
 */

(function() {
    // verificar si hay documento abierto
    if (!documents.length) {
        alert("Debes abrir un documento", "Script Error !!", true);
        return;
    }

    var doc = app.activeDocument;
    var docPath = doc.path.fsName;
    var newFolderName = 'Files';
    var newFolderPath = docPath + '/' + newFolderName;

    function createFolder(folderPath) {
        var newFolder = new Folder(folderPath);
        if (!newFolder.exists) {
            return newFolder.create();
        }
        return false;
    }

    function saveAsEPS(document, savePath) {
        var fileName = document.name.replace(/\.[^\.]+$/, '');
        var epsOptions = new EPSSaveOptions();
        epsOptions.cmykPostscript = true;
        epsOptions.compatibilityFormat = Compatibility.ILLUSTRATOR8;
        epsOptions.compatibleGradientPrinting = false;
        epsOptions.embedAllFonts = true;
        epsOptions.embedLinkedFiles = true;
        epsOptions.flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;
        epsOptions.includeDocumentThumbnails = true;
        epsOptions.overprint = PDFOverprint.PRESERVEPDFOVERPRINT;
        epsOptions.postScript = EPSPostScriptLevelEnum.LEVEL2;
        epsOptions.preview = EPSPreview.COLORTIFF;
        epsOptions.saveMultipleArtboards = true;

        var saveFile = new File(savePath + "/" + fileName + ".eps");
        document.saveAs(saveFile, epsOptions);
    }

    function showErrorDialog() {
        var errorWindow = new Window("dialog", "Detalle de Error");
        var panel = errorWindow.add("panel");
        var group = panel.add("group");
        group.orientation = "column";
        group.add("statictext", undefined, "\u274c Folder ya existe!");
        group.add("button", undefined, "Ok");
        errorWindow.show();
    }

    // Ejecutar Script
    if (createFolder(newFolderPath)) {
        saveAsEPS(doc, newFolderPath);
        doc.close(SaveOptions.DONOTSAVECHANGES);
    } else {
        showErrorDialog();
    }

})();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines