【发布时间】:2022-12-16 09:02:31
【问题描述】:
如何从我的 C++ 应用程序中运行 Adobe Extend Scripts?如果我打开 After Effects 项目并运行脚本,我有一个工作 JSX 文件可以完成我需要的工作。
我本质上是想在使用 C++ 的 After Effects 项目上调用 JSX 脚本。
我问了 ChatGPT 这个问题(我太现代了),它提到了以下代码:
#include <iostream>
#include "extendscript.h"
int main()
{
// Create an instance of the ExtendScript object
ExtendScript script;
// Load the ExtendScript script file
if (!script.LoadScriptFile("myscript.jsx"))
{
std::cerr << "Failed to load script file" << std::endl;
return 1;
}
// Set the 'this' property of the ExtendScript object to the current After Effects project
script.SetThisProperty(app.project);
// Execute the script
if (!script.EvaluateScript())
{
std::cerr << "Failed to evaluate script" << std::endl;
return 1;
}
// Retrieve the project name from the script
ExtendScriptValue result = script.GetGlobalProperty("projectName");
// Print the project name
std::cout << "The project name is: " << result.ToString() << std::endl;
return 0;
}
这看起来很酷,但我找不到任何与上述 API 调用匹配的在线内容,也找不到任何方法来找到这个难以捉摸的“extendscript.h”文件。
完全有可能是 ChatGPT 编造了这一切并给了我错误的希望。
【问题讨论】:
标签: c++ adobe extendscript after-effects