没有对话框保存 [英] Saving without dialog window

查看:90
本文介绍了没有对话框保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个脚本,该脚本将使Photoshop CS5的许多操作自动化.其中一部分涉及保存一堆文件.有没有一种方法可以以不打开对话框窗口的方式保存文件?我一直在查看建议我使用一个操作来处​​理它,但我真的不愿意这样做那.

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 doesn't open up a dialog window? I've been looking over the JavaScript Tools Guide, but I didn't see a way to do this. This suggested I used an action to deal with it but I'd really prefer not to do that.

特别是我想将文件另存为crytiff格式,但我只想知道如何保存具有所需扩展名的文件

specifically I want to save the files as crytiff format but I'd just like to know how to save a file with whatever extension I want

推荐答案

以下内容将活动文档另存为PNG.您可以更改类型以将其另存为.

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); 

这篇关于没有对话框保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆