fx2008

#target "photoshop"
 
var outputWidth = 1024;
var inputFolder = Folder.selectDialog("Input folder");
var outputFolder = Folder.selectDialog("Output folder");
 
if (inputFolder != null && outputFolder != null) {
    var files = inputFolder.getFiles("*.psd");
 
    for (var i = 0; i < files.length; i++) {
 
        var file = files[i];
        var doc = app.open(file);
 
        if (doc.width > outputWidth) {
            var height = (doc.height / doc.width) * outputWidth;
            doc.resizeImage(outputWidth + "px", height + "px");
        }
 
        var options = new ExportOptionsSaveForWeb();
        options.format = SaveDocumentType.PNG;
        options.PNG8 = false;
 
        doc.exportDocument(outputFolder, ExportType.SAVEFORWEB, options);
        doc.close(SaveOptions.DONOTSAVECHANGES);
        $.writeln(\'File \' + (i + 1) + \' of \' + files.length + \' processed\');
    }
}

//放置在C:\Program Files\Adobe\Adobe Photoshop CS5 (64 Bit)\Presets\Scripts\批量导出图片.jsx

 

 

分类:

技术点:

相关文章:

  • 2021-09-23
  • 2021-06-18
  • 2021-11-17
  • 2022-01-11
  • 2021-12-22
  • 2021-11-27
  • 2021-12-01
猜你喜欢
  • 2021-12-03
  • 2021-11-23
  • 2021-12-03
  • 2021-04-01
  • 2021-09-29
  • 2021-09-15
相关资源
相似解决方案