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

Batch Export as PNG

New Here ,
Mar 11, 2009 Mar 11, 2009

Copy link to clipboard

Copied

Hello, i'm having dreadful trouble exporting a batch of AIs to PNG (using illustrator CS4).

It seemed really obvious to record export>PNG>relevant setting as an action and then run that on the whole folder.

The trouble is that the action, when run as a batch (and only when run as a batch) skips the whole export step. it open the AI fine, runs through the action very quickly, and then fails to write the PNG.

what's more, i also tried this on a colleagues machine and his did exactly the same, so i'm thinking that it's me missing something obvious.

as a workaround i turned the dialogues on, but this kind of defeats the object.

any help would be very greatly appreciated.

cheers
Jez

Views

51.0K

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
New Here ,
Jan 07, 2020 Jan 07, 2020

Copy link to clipboard

Copied

After I've created the Acrobat Portfolio file containing the 80+ AI files, all of the graphic file options (File>Export>Image>...PNG) is grayed out.

Suggestions???

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
Explorer ,
Oct 07, 2015 Oct 07, 2015

Copy link to clipboard

Copied

This is great. I don't understand the problem. thanks to Larry G. Schneider

Copy tekst below. Open the program 'extendedScript Toolkit' (in Adobe Utilities), past it and save 'yourScript' into (Illustrator Folder> Presets>Scripts). Restart AI. Open AI and with no file opened go to >File >Scripts > and run 'yourScript'.

The script asks you to 'Choose Folder'. Then, 'select type of illustrator files you want to process'. Then fill in '*.ai' (don't forget that asterisk and the dot before ai, or eps). Then 'Choose -destination Folder'. Done an Run

/**********************************************************

ADOBE SYSTEMS INCORPORATED

Copyright 2015 Adobe Systems Incorporated

All Rights Reserved

NOTICE:  Adobe permits you to use, modify, and

distribute this file in accordance with the terms

of the Adobe license agreement accompanying it. 

If you have received this file from a source

other than Adobe, then your use, modification,

or distribution of it requires the prior

written permission of Adobe.

*********************************************************/

/**********************************************************

ExportDocsAsPNG24fromFolder.jsx

DESCRIPTION

This sample gets files specified by the user from the

selected folder and batch processes them and saves them

as PNGs in the user desired destination with the same

file name.

**********************************************************/

// Main Code [Execution of script begins here]

// uncomment to suppress Illustrator warning dialogs

// app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pngExportOpts;

// Select the source folder.

sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files you want to convert to PNG', '~' );

// If a valid folder is selected

if ( sourceFolder != null )

{

    files = new Array();

    fileType = prompt( 'Select type of Illustrator files to you want to process. Eg: *.ai', ' ' );

   

    // Get all files matching the pattern

    files = sourceFolder.getFiles( fileType );

   

    if ( files.length > 0 )

    {

        // Get the destination to save the files

        destFolder = Folder.selectDialog( 'Select the folder where you want to save the converted PNG files.', '~' );

        for ( i = 0; i < files.length; i++ )

        {

            sourceDoc = app.open(files); // returns the document object

                                   

            // Call function getNewName to get the name and file to save the png

            targetFile = getNewName();

           

            // Call function getPNGOptions get the PNGExportOptions for the files

            pngExportOpts = getPNGOptions();

           

            // Export as PNG

            sourceDoc.exportFile( targetFile, ExportType.PNG24, pngExportOpts );

           

            sourceDoc.close(SaveOptions.DONOTSAVECHANGES);

        }

        alert( 'Files are saved as PNG in ' + destFolder );

    }

    else

    {

        alert( 'No matching files found' );

    }

}

/*********************************************************

getNewName: Function to get the new file name. The primary

name is the same as the source file.

**********************************************************/

function getNewName()

{

    var ext, docName, newName, saveInFile, docName;

    docName = sourceDoc.name;

    ext = '.png'; // new extension for png file

    newName = "";

       

    for ( var i = 0 ; docName != "." ; i++ )

    {

        newName += docName;

    }

    newName += ext; // full png name of the file

   

    // Create a file object to save the png

    saveInFile = new File( destFolder + '/' + newName );

    return saveInFile;

}

/*********************************************************

getPNGOptions: Function to set the PNG saving options of the

files using the PNGSaveOptions object.

**********************************************************/

function getPNGOptions()

{

   

    // Create the PNGSaveOptions object to set the PNG options

    var pngExportOpts = new ExportOptionsPNG24();

   

   

   

    // Setting PNGExportOptions properties. Please see the JavaScript Reference

    // for a description of these properties.

    // Add more properties here if you like

    pngExportOpts.antiAliasing = true;

    pngExportOpts.artBoardClipping = false;

    //pngExportOpts.horizontalScale = 100.0;

    //pngExportOpts.matte = true;

    //pngExportOpts.matteColor = 0, 0, 0;

    pngExportOpts.saveAsHTML = false;

    pngExportOpts.transparency = true;

    //pngExportOpts.verticalScale = 100.0;

    return pngExportOpts;

}

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
Community Beginner ,
Nov 10, 2015 Nov 10, 2015

Copy link to clipboard

Copied

Thanks!

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
New Here ,
Jun 17, 2016 Jun 17, 2016

Copy link to clipboard

Copied

Hello Pelter,

Thank you for the script and it is very helpful. I was wondering is there a way to specify in the script which Artboard to export the PNG since Illustrator don't have pages. Name: Artboard 1 and Artboard 2 for different art works?

Much appreciated.

Best Regards,

Jeff

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
New Here ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Hi,

When I select the script it lets me select a folder, but then it asks me what type of file. What do i put here? I typed in .ai, but then it says it can't find that file.

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
Community Expert ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Try using *.ai. The asterisk is a wild card for "any file".

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
New Here ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Larry,

I tried that

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
Community Expert ,
Jul 20, 2016 Jul 20, 2016

Copy link to clipboard

Copied

Can you show a screenshot of the folder selected with it opened so we can see the file list of that folder?

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
New Here ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Hi Larry

Thanks for the script.

It doesn't seem to work in Illustrator CC though, it just outputs a small percentage of my files, and they don't have the correct file name either - just 0.png, 1.png etc.

Do you have an update that might work?

Thanks!

Mark

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
New Here ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Hi Guys,

This script worked for me. I am running Adobe Illustrator CC and found this script by Export Illustrator Layers and/or Artboards as PNGs and PDFs | Matthew Ericson - ericson.net

To use the script, download MultiExporter.jsx and put in your Illustrator scripts folder (usually in Applications/Adobe Illustrator/Presets/Scripts/). Restart Illustrator, and run the script by going to “File > Scripts > MultiExporter”.

Here's the trick.

Once installed, Start Illustrator, and open up the file with the multiple Artboards.  Go to the Artboards TAB and change the artboard names to something else, I named mines LOGO

More notes..

You can choose whether you want to export all the artboards in the document with the currently visible layers showing, or if you want to export files for each of the layers in a document on the currently active artboard, or if you want to export a combination of all the artboards multiplied by all the layers.

  • Files are named based on their layer name. It only exports layers where their name has been changed from the default “Layer 1″, “Layer 2″ or “Artboard 1”, “Artboard 2”, etc.
  • If you put a minus sign  in front of a layer name or artboard name, it will skip that layer or artboard. (Useful for when you no longer decide you like a particular mockup, but don’t want to delete it from the master Illustrator document.)
  • For layers only: If you put a plus sign  in front of a layer name, that layer will always be visible. Useful for if you want to have a layer that always appears in the background of each exported image.
  • It stores its settings in a nonvisible, nonprinting layer named “nyt_exporter_info”
  • It has an option for transparency, and lets you choose between PNG8, PNG24 and PDF.

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