Adobe Illustrator:运行 python 来自 Windows 中的 Extendscript 的文件

Adobe Illustrator: Run python file from Extendscript in Windows

我在 运行 运行此脚本时遇到问题 (time.jsx):

var timeStr = system.callSystem("cmd.exe /c \"time /t\"");

alert("Current time is " + timeStr); Documentation of AE

它在 Adobe After Effects 中有效,但我想专门在 illustrator 中使用它。基本上,我想从 Extendscript(.jsx) 运行 我的 Python 脚本。但是我还没有找到任何解决方案。

感谢您的帮助。 提前致谢。

我找到了一种在 Extendscripts(*.jsx) 中执行 Python 或其他脚本的方法,就是这样,在 documentation which has a function named execute(); which executes the scripts according to their statement。比如你想通过.jsx文件在python中执行hello world,你需要制作一个 py 文件 包括 print("hello world")。之后,在 script.jsx 脚本中添加这些行:

var pyHello = new File("<path of py file>");

var bool = pyHello.execute();

alert(bool);

如果执行脚本,则为true,否则为false