3

我有一个用于 photoshop 的 script.jsx,它可以从许多 PSD 文件中导出一些东西。有时(20 个文件中有 1 个),在打开 psd 文件时,会显示以下对话框:

var fileToOpen = new File(...);
open(fileToOpen);

烦人的对话

我在数百个文件上运行这个脚本,我需要它以某种方式忽略这些对话框。“保留图层”可以,但一般来说,任何会阻止对话的东西都会有所帮助。

我在手册中找到了选项 suppressWarnings,但它仅适用于PdfOpenOptionsor PhotoshopSaveOptions- 没有PsdOpenOptionsor之类的东西PhotoshopLoadOptions,简单对象也{suppressWarnings: true}不起作用。我什至尝试添加displayDialogs = DialogModes.NO,但这也无济于事。

有没有办法阻止这个对话框?(即阻止它阻止脚本的执行)

4

1 回答 1

1

尝试try catch施工。如果这没有帮助,则设置用户交互(尽管这可能很麻烦): https ://forums.adobe.com/thread/289239?tstart=0

例子:

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
var fileToOpen = new File(...);
open(fileToOpen);
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 
于 2016-02-18T16:26:09.853 回答