Saving without dialog window

前端 未结 3 1956
死守一世寂寞
死守一世寂寞 2021-01-27 06:26

I\'m trying to write a script that will automate a bunch of stuff for Photoshop CS5. Part of this involves saving a bunch of files. Is there a way to save a file in a way that d

3条回答
  •  囚心锁ツ
    2021-01-27 06:50

    The following saves the active document as PNG. You can change the type to save it as.

    // reference open doc
    var doc = app.activeDocument;
    
    // set save options
    var opts = new ExportOptionsSaveForWeb();
    
    opts.PNG8 = false;
    opts.transparency = true;
    opts.interlaced = false;
    opts.quality = 100;
    opts.includeProfile = false;
    opts.format = SaveDocumentType.PNG; // Document Type
    
    // save png file in same folder as open doc
    activeDocument.exportDocument(doc.path, ExportType.SAVEFORWEB, opts); 
    

提交回复
热议问题