如何使用extendscript打开另一个应用程序? [英] How to use extendscript to open another application?
问题描述
我试图通过使用extendscript通过cmd行(system.callSystem)发送命令来了解是否/如何从After Effects中打开外部程序,但是无法解决... >
例如,要从命令行打开Premiere Pro版本,可以使用直接路径:
cd C:\ Program Files \ Adobe \ Adobe Premiere Pro CC 2019 \&&"Adobe Premiere Pro.exe";
但是无法通过extendscript读取路径,例如,我尝试过:
system.callSystem("cmd.exe/c \" cd C:\ Program Files \ Adobe \ Adobe Premiere Pro CC 2019 \&" Adobe Premiere Pro.exe"");
如何通过extendscript发送类似这样的cmd行命令?任何帮助表示赞赏.
我不确定我是否完全理解您的问题.您可以从Extend Script中创建一个包含所有命令的.BAT文件,然后执行该文件.这是打开记事本的示例:
function run(cmd){var f = new File(Folder.temp.fsName +"/temp.bat");f.open("w");f.writeln(cmd);f.close();f.execute();}运行("c:/Windows/notepad.exe");
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.
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");
这篇关于如何使用extendscript打开另一个应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!