【问题标题】:Photoshop script - suppressWarnings, disable error dialogsPhotoshop 脚本 - suppressWarnings,禁用错误对话框
【发布时间】:2013-09-30 08:41:43
【问题描述】:

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

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

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

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

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

【问题讨论】:

    标签: scripting photoshop jsx


    【解决方案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; 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-02
      • 2016-05-21
      • 1970-01-01
      • 1970-01-01
      • 2021-04-12
      • 2010-10-30
      • 1970-01-01
      相关资源
      最近更新 更多