Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Extendscript – After Effects warning: Reading past end of file, After Effects Error: strange situation [0/2]

  • Extendscript – After Effects warning: Reading past end of file, After Effects Error: strange situation [0/2]

    Posted by Spencer Tweed on May 31, 2017 at 10:02 pm

    I’m working on a tool and as part of it I save out an after effects file using extendscript. When I run my script via the GUI I get no problems but when I run it via the commandline I get the above error message when I try to open the new file. Everything seems to be totally the same between the commandline version and the gui version so I’m not sure what to do here. I realize this is probably a bug, and if so I need a workaround…

    Here’s a snippet of my script running via the GUI:

    newFile = new File("E:/Programming/Python/Archive tool/AE Project Test/SaveTest.aep");
    app.project.save(newFile);
    app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);
    app.quit();

    I can open this new file no problem.

    And to run it via commandline I do the following – this is python but I don’t think you need to know python to understand what is happening. I just create a new .jsx file with the same code as above in it (except now I have to tell AE to open the project) and run that script via the commandline:

    executeCollectScript.write("""myProject = File('""" + aeProject + """');
    app.open(myProject);
    newFile = new File("E:/Programming/Python/Archive tool/AE Project Test/SaveTest.aep");
    app.project.save(newFile);
    app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);
    app.quit();""")
    executeCollectScript.close()

    ae_app = "C:/Program Files/Adobe/Adobe After Effects CS6/Support Files/afterfx.exe"
    filename = filename.replace("/", "\\")

    command = '"' + ae_app + '"' + ' -noui -r ' + filename
    aeProcess = QtCore.QProcess()
    aeProcess.start(command)

    …aaand now I get an error. The really wacky thing is if I try running the above python code with After Effects open, AE funnily enough will actually run it in the GUI (ignoring the -noui arg for some reason) at which point it works totally fine! So I think I’ve pretty conclusively proven that “app.project.save” does not work via the commandline version of AE… Please correct me if I am wrong!

    This is all on windows 7 with AE CS6 (sorry, still haven’t upgraded due to specific bugs)

    PS I realize this error has come up numerous times in the forums and yes I did read through those, but they all seemed to deal with footage and not project files.

    Spencer Tweed replied 8 years, 11 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy