Copy link to clipboard
Copied
Is it possible to create an after effects project from writing a script and then calling that script from outside of After effects.
I tried using this in my script:
var currentProject = (app.project) ? app.project: app.newProject();
but I get the error that "app is not defined"
Copy link to clipboard
Copied
app.project is a collection and even with no assets or comp, the project itself already exists, so I'm not sure what you are trying to do there. It's pretty much irrelevant, since AE doesn't auto-open the last projects like some programs do, anyway, so you're always operating on a blank, unsaved project to begin with and are free to do whatever you fancy.
Mylenium
Copy link to clipboard
Copied
What exactly do you mean with "calling a script from outside of After Effects"?
You can ask Ae to execute scripts via the command line i.e.
afterfx -r c:\script_path\example_script.jsx
If you are talking about executing some JavaScript outside of After Effects (like using node), there will be no app object, of course. To execute Ae scripts from node, you can use
https://www.npmjs.com/package/after-effects