问题
I'm trying to undertand if/how I can open an external program from After Effects by using extendscript to send a command through the cmd line (system.callSystem), but can't work it out...
For example, to open a version of Premiere Pro from command line I can use the direct path:
cd C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\ && "Adobe Premiere Pro.exe"
but can't get paths to be read through extendscript, eg I tried:
system.callSystem("cmd.exe /c \"cd C:\Program Files\Adobe\Adobe Premiere Pro CC 2019\ && "Adobe Premiere Pro.exe"\"");
How do I send cmd line commands like this through extendscript? Any help appreciated.
回答1:
I'm not sure if I fully understand your question. From Extend Script you can make a .BAT file with any commands within and execute it. Here is the example how you can open Notepad:
function run(cmd) {
var f = new File(Folder.temp.fsName + "/temp.bat");
f.open("w");
f.writeln(cmd);
f.close();
f.execute();
}
run("c:/Windows/notepad.exe");
来源:https://stackoverflow.com/questions/63222557/how-to-use-extendscript-to-open-another-application