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

Error 8800 when trying to save as PNG

Community Beginner ,
Dec 17, 2017 Dec 17, 2017

Copy link to clipboard

Copied

Hey there!

I'm trying to save a bunch of PSD files as pngs but the script fails when saving, giving the error:

Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.

- <no additional information available>

Line: 27

->  docRef.exportDocument(pngFile, ExportType.SAVEFORWEB, opts);

My script:

var allFiles = app.openDialog();

var allPSDs = new Array();

var fileMask = /\.(psd|)$/i;

for(var i = 0; i < allFiles.length; i++)

{

if (allFiles instanceof File && allFiles.fullName.search(fileMask) != -1)

allPSDs.push(allFiles);

}

for(var i = 0; i < allPSDs.length; i++)

{

var docRef = app.open(allPSDs);

var pngFile = new File(activeDocument.path.fullName + "/Export/" + docRef.name + '.png');

docRef.flatten();

var opts = new ExportOptionsSaveForWeb();

opts.format = SaveDocumentType.PNG;

opts.PNG8 = false;

opts.transparency = false;

opts.interlaced = false;

opts.quality = 100;

opts.includeProfile = false;

docRef.exportDocument(pngFile, ExportType.SAVEFORWEB, opts);

// also doesn't work / gives the same error:

// var pngSaveOptions = new PNGSaveOptions();

// app.activeDocument.saveAs(pngFile, pngSaveOptions, true, Extension.LOWERCASE);

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

}

What did I do wrong?

TOPICS
Actions and scripting

Views

2.1K

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

correct answers 1 Correct answer

Community Beginner , Dec 17, 2017 Dec 17, 2017

UGH. I figured it out: the Export folder didn't exist.

What a stupid Error message for an error like this. Ugh.

Votes

Translate

Translate
Adobe
LEGEND ,
Dec 17, 2017 Dec 17, 2017

Copy link to clipboard

Copied

Are there layers or is the PSD a 16 bit file. No layers allowed or 16 bit version in PNGs.

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 ,
Dec 17, 2017 Dec 17, 2017

Copy link to clipboard

Copied

Nope, neither! I even flatten the image in the script

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 ,
Dec 17, 2017 Dec 17, 2017

Copy link to clipboard

Copied

LATEST

UGH. I figured it out: the Export folder didn't exist.

What a stupid Error message for an error like this. Ugh.

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