nodejs execsync命令失败

问题描述 投票:0回答:1

我正在尝试运行execSync文件:

try {
    const child_process = require("child_process")
    child_process.execSync('"C:/Program Files/Adobe/Adobe Photoshop CC 2019/Photoshop.exe" Z:/myfile.jsx', (err, stdout, stderr) => {
    if (err) {
        console.log("error here");
    }
})
    .on('close', function (code, signal) {console.log('go to next step')})
} catch (err) {
    err.stdout;
    err.stderr;
    err.pid;
    err.signal;
    err.status;
}

该脚本运行但是退出代码为1:

Error: Command failed: "C:/Program Files/Adobe/Adobe Photoshop CC 2019/Photoshop.exe" Z:/myfile.jsx

我怎么能摆脱这个。

javascript node.js child-process extendscript
1个回答
0
投票

我终于通过在jsx文件中写了一个photoshop退出代码来解决它,它关闭了photoshop并给了我一个成功代码

© www.soinside.com 2019 - 2024. All rights reserved.