将python脚本的结果传递给ExtendScript`.jsx`文件
因此,我正在编写一个python脚本,该脚本从google工作表中获取数据,并将其返回到我正在为后效编写的ExtendScript脚本 相关位为: getSpreadsheetData.py将python脚本的结果传递给ExtendScript`.jsx`文件,python,google-sheets,jsx,extendscript,Python,Google Sheets,Jsx,Extendscript,因此,我正在编写一个python脚本,该脚本从google工作表中获取数据,并将其返回到我正在为后效编写的ExtendScript脚本 相关位为: getSpreadsheetData.py def main(): values = getSpreadsheetRange("1M337m3YHCdCDcVyS4fITvAGJsw7rGQ2XGbZaKIdkJPc", "A1:Q41") return processValues(values) 后效脚本.jsx var scri
def main():
values = getSpreadsheetRange("1M337m3YHCdCDcVyS4fITvAGJsw7rGQ2XGbZaKIdkJPc", "A1:Q41")
return processValues(values)
后效脚本.jsx
var script_file = File("getSpreadsheetData.py");
var results = script_file.execute();
$.writeln(results);
alert("done!");
因此,我有三个问题:
afterEffectsScript.jsx
传递到python脚本(例如电子表格id和范围)jsx
文件afterEffectsScript
异步工作,以便它可以等待python脚本获得所需的内容-p您可以通过设置环境变量来传递变量。 如何使用extendscript中的参数调用外部脚本的小示例:
var script_file = File("getSpreadsheetData.py");
$.setenv("arg_1", "arg1_value");
$.setenv("arg_2", "arg2_value");
script_file.execute();
python脚本应该首先从环境中读取以下变量:After Effects可以调用系统命令并获得stdout的结果
var cmd = "pwd";
var stdout = system.callSystem(cmd);
$.writeln(stdout);
看看啊哈,这听起来像是解决第1点和第2点的办法!当环境变量改变值以回答第3点时,是否有办法倾听?我假设我会从python操作一个环境变量&从ExtendScript访问它,而不是像我在这里所做的那样使用
results
变量