将python脚本的结果传递给ExtendScript`.jsx`文件 [英] Passing the result of a python script to an ExtendScript `.jsx` file
问题描述
getSpreadsheetData.py
def main():
pre>
values = getSpreadsheetRange(1M337m3YHCdCDcVyS4fITvAGJsw7rGQ2XGbZaKIdkJPc,A1:Q41)
return processValues(values)
afterEffectsScript.jsx
var script_file = File(getSpreadsheetData.py);
var results = script_file.execute();
$ .writeln(results);
alert(done!);
所以,我有三个问题:
如何将变量从
afterEffectsScript.jsx
传递给python脚本(例如电子表格ID和范围)? p>
如何从python脚本返回并将它返回给
jsx
文件?
如何让我的
afterEffectsScript
工作异步,以便它可以等待Python脚本获取它需要...
感谢您的建议!
-P
解决方案After Effects可以调用系统命令并获得
标准输出
。var cmd =pwd;
var stdout = system.callSystem(cmd);
$ .writeln(stdout);
查看 AE脚本指南
So, I'm writing a python script that gets data from a google sheet and returns it back to an ExtendScript script that I'm writing for After Effects.
The relevant bits are :
getSpreadsheetData.py
def main(): values = getSpreadsheetRange("1M337m3YHCdCDcVyS4fITvAGJsw7rGQ2XGbZaKIdkJPc", "A1:Q41") return processValues(values)
afterEffectsScript.jsx
var script_file = File("getSpreadsheetData.py"); var results = script_file.execute(); $.writeln(results); alert("done!");
So, I have three questions :
How do I pass variables from the
afterEffectsScript.jsx
to the python script (for example the spreadsheet id and range)?How do I get a return from the python script and return it back to the
jsx
file?How do I make my
afterEffectsScript
to work async so that it can wait for the python script to get what it needs...Thanks in advance for the advice!
-P
解决方案After Effects has the possibility to call system commands and get the result of
stdout
.var cmd = "pwd"; var stdout = system.callSystem(cmd); $.writeln(stdout);
Take a look into the AE Scripting Guide
这篇关于将python脚本的结果传递给ExtendScript`.jsx`文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!