Saving without dialog window

前端 未结 3 1966
死守一世寂寞
死守一世寂寞 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:32

    Open: Windows > Actions You will find Toggle Dialog On/Off check box before every action. Turn it off.

    0 讨论(0)
  • 2021-01-27 06:43

    Try using Document.saveAs(). But, like El Cas said, you still have to pass in some kind of SaveOptions object. You don't necessarily have to specify all the options if you don't want. You can just use the generic object like this:

    app.activeDocument.saveAs(new File(doc.path + "/myDocument"), TiffSaveOptions);
    // or BMPSaveOptions or GIFSaveOptions or JPEGSaveOptions...
    

    Here's a much more complete Photoshop CS5 Javascript Reference

    0 讨论(0)
  • 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); 
    
    0 讨论(0)
提交回复
热议问题