Copy link to clipboard
Copied
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???
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;
}
Copy link to clipboard
Copied
Thanks!
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
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.
Copy link to clipboard
Copied
Try using *.ai. The asterisk is a wild card for "any file".
Copy link to clipboard
Copied
Larry,
I tried that
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?
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
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.