Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Running a script from the command line is opening the After Effects GUI

Explorer ,
Apr 04, 2020 Apr 04, 2020

Hi there,

I'm wanting to headlessly run a script using the AfterFX -r command like so:

 

afterfx -r c:\script.jsx

 

But this seems to open up the full After Effects interface, runs the script, then immediately closes After Effects, I was wondering if this is normal, is it not meant to run the script headlessly, as in no GUI? The fact that in opens up After Effects seems to defeat the point, or am I missing something?

 

Thanks for any clarification on this

Steve

TOPICS
Scripting
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2020 Apr 04, 2020

Okay I've figured it out, seems that I can just use -noui to execute without opening the ui

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 06, 2020 Apr 06, 2020

The -noui flag is pretty glitchy. I'd recommend using the AfterFX.com executable for headless on Windows, or aerender.exe if you only need to render.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 06, 2020 Apr 06, 2020

Great, thanks for the advice 👍

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 05, 2020 Jun 05, 2020

Hi

 

I am running the script from cmd line using -noui flag but it gives me error error.pngexpand image

and if I run this without -noui flag it opens the After Effects and run the script without any problem but -noui flag gives the warning "Could not rename the file".

this is the test script below:-

app.beginUndoGroup("test");



var myAepFile = File("~Desktop//testTemplate//testTemplate.aep");
if (myAepFile.exists) {

app.open(myAepFile); //fails on this line with app.open is not a function

}

app.project.close(CloseOptions.SAVE_CHANGES);

app.endUndoGroup();

 

Any help would be much appreciated

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 05, 2020 Jun 05, 2020

Try running as administrator, or reset the permissions of that file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 05, 2020 Jun 05, 2020

Hi Justin,

Yes I tried run it as administrator but no avails . BTW how we can change permissions of the file?

 

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 06, 2020 Jun 06, 2020

I think you're on Windows, here's how: https://www.laptopmag.com/articles/take-ownership-folder-windows-10-using-file-explorer

 

Or you can just create a new script file in a non-restricted location and try that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2020 Jun 08, 2020
LATEST

Hi Justin,

 

I have tried everything but nothing works. It's weird that it only works when After Effect is open but doesn't work when it opens in background.

 

Let me know if have any other solution.

Thanks anyway.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines