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

"file.length" is not accuracy

Community Beginner ,
Nov 12, 2016 Nov 12, 2016

Copy link to clipboard

Copied

var saveFile = new File(et_outpath.text + "/" + (m + 1) + "_" + (n + 1) + houzui);

                do {

                qlty = qlty-5;

                saveFile=new File(exportWeb (saveFile,qlty,format,png8))

                saveFile.remove();

                exportWeb (saveFile, qlty, format,png8);

                     if (qlty<=0){

                         alert("无法压缩至指定文件大小");

                            app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

                            ac_doc.selection.deselect();

                            w.enabled = true;

                            bt_cut.text = "开始";

                            return;

                        }

                } while (saveFile.length > parseInt(et_imgkb.text)*1024)

         app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

QQ截图20161112172153.png

TOPICS
Actions and scripting

Views

288

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 ,
Nov 12, 2016 Nov 12, 2016

Copy link to clipboard

Copied

LATEST

You could enter the full script

and thus more clearly the problem.

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