Ausgabe
Ich habe also eine persönliche Website und eine Schaltfläche, mit der ich Photoshop öffnen und ein Skript für mich ausführen möchte. Wie mache ich das?
Lösung
Dies ist seit einiger Zeit so, aber wenn die Lösung dafür in node darin besteht, einen child_process.
du kannstnpm install child_process
und der Code zum Ausführen von ausführbaren Dateien wäre zu tun
const exec = require("child-process").execFile;
var process = exec("Photoshop.exe", [*add options here*], {cwd:"C:/*path to photoshop*"});
Sie können danach viele coole Dinge wie Event-Handler tun
process.on("close", code => {
console.log("process closed with code: "+ code)
})
process.on("exit", code => {
console.log("process exited with code: "+ code)
})
process.stdout.on("data", data => {
console.log(data)
})
Sie können die Dokumente hier lesen: https://nodejs.org/api/child_process.html
Beantwortet von – Eric Chu
Antwort geprüft von – Dawn Plyler (FixError Volunteer)