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

Running Script File without UI from command prompt

Explorer ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

Without getting into too much unnecessary details, I have a script I wrote that opens some files, changes a few things, and saves it as a new file.  That is the basics of what it does.  Nothing too fancy, and I don't need the UI to run it.  More importantly, I don't WANT the UI to open at all when this runs, it is completely pointless to have it open for this script.

I would LOVE to be able to call this from other apps, but a command prompt will work great.

I have seen posts about afterfx.exe and afterfx.com, neither of them work.  I used them with the -noui flags (no clue what they mean), and it did nothing.  no errors, no sign of it running at all.

If anyone know what flags I need to use to make this happen, please let me know.  If anyone knows of a way I can call this script from anything that can be automated, please let me know.

Thanks in advance!

Brad

TOPICS
Scripting

Views

5.2K

Translate

Translate

Report

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 ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

In order to execute a script from command prompt you need to use this:

afterfx.exe -r "c:\myDocuments\Scripts\Script Name with Spaces.jsx"

Note that this should be ran inside the after effects install folder in the command prompt. If you want to use it from any other place, the full command would be:

"C:\Program Files\Adobe\Adobe After Effects CC 2019\Support Files\afterfx.exe" -r "c:\myDocuments\Scripts\Script Name with Spaces.jsx"

Also, sometimes this command line need the quotes from the script path removed, so it could be:

"C:\Program Files\Adobe\Adobe After Effects CC 2019\Support Files\afterfx.exe" -r c:\myDocuments\Scripts\Script Name with Spaces.jsx

If, however, your script has an UI, this will open it. If you want to run it without a UI you must not create that UI in the first place.

Some elements of the paths i used in the commands may vary for your pc.

Votes

Translate

Translate

Report

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 ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

So, it must think I want to open the UI because I am opening a file.  I will see if I can make some changes.

Votes

Translate

Translate

Report

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 ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

I think I will have to use another type of scripting language to do what I want to do.  It appears that me opening or dealing with AEPX files makes the script think I want to use them in AE.  It makes sense, but it is not what I am trying to do.

Thanks

Votes

Translate

Translate

Report

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 ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

Can you describe what your script does? If you're just modifying AEPX files then you don't even need to launch any form of After Effects for that. On Mac I'd recommend using aerendercore for headless stuff, on Windows use AfterFX.com with the noui flag like so:

For inline scripts:

AfterFX.com -noui -s "alert('test')"

For script files:

AfterFX.com -noui -r "C:\Users\Justin\Desktop\test.jsx"

Votes

Translate

Translate

Report

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 ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

I am changing a handful of values in the files and saving them into another directory.  I have tried the -noui switches many times, with and without quotes.  It hasn't worked.  I have tried afterfx.exe AND afterfx.com.  Nothing works.  Keep in mind the script works flawlessly when run inside the editor, even without the UI opening.  Since this needs to be automated, and completely hands off, it needs to work without supervision.

Everything this little script does can be done with another scripting language that will not rely on the UI opening.  With the end goal in mind, I can't have this type of little bug happening or putting a wrench in things.  I need something that just works.  No worries, I was just hoping it would work easier.

Thanks

Votes

Translate

Translate

Report

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 ,
Jul 11, 2019 Jul 11, 2019

Copy link to clipboard

Copied

Well, if it's simple find and replace text in a file, a Bat file on Windows or Shell file on Mac will suffice.

However, while we're on the topic, explain exactly how afterfx.exe and afterfx.com are not working. What error messages are you receiving? Are you navigating to the program folder before trying to run them in CMD / Terminal?

Votes

Translate

Translate

Report

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 ,
Jul 12, 2019 Jul 12, 2019

Copy link to clipboard

Copied

afterfx.com - No error messages.  just stops.  I let it sit for several hours, a few times. nothing
afterfx.exe - it doesn't even do anything.

Like you said, there are other ways to make this work, and that is probably what I will do.  I didn't realize that this would be such an ordeal to get to work.  No big deal to me, at least I learned about scripting AE .

Votes

Translate

Translate

Report

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 ,
Jul 12, 2019 Jul 12, 2019

Copy link to clipboard

Copied

Just triple checking that you're executing the processes correctly:

1. Your Command Prompt directory is:  C:\Program Files\Adobe\Adobe After Effects CC 2019\Support Files

2. You've tried running: AfterFX.com -noui -s "alert('test')"

(should look like this)

If it's still not working, you may consider re-installing After Effects.

Votes

Translate

Translate

Report

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 ,
Jul 12, 2019 Jul 12, 2019

Copy link to clipboard

Copied

I am sure I am running it in the right folder.  If I was not, there would be an error.

Votes

Translate

Translate

Report

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 ,
Jul 12, 2019 Jul 12, 2019

Copy link to clipboard

Copied

Might need to re-install then. Also, make sure it's not already running in the background.

Votes

Translate

Translate

Report

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 ,
Jul 12, 2019 Jul 12, 2019

Copy link to clipboard

Copied

This is the first time I have seen the "-s" switch in the command.  I run it this way now, and I get "Unable to execute script at line 1.  Syntax Error.

Well, the script runs fine in the ExtendScript app.  Too much hassle for a simple thing.

Votes

Translate

Translate

Report

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 ,
Jul 12, 2019 Jul 12, 2019

Copy link to clipboard

Copied

Also, justintaylor, I just looked at your vimeo vid.  Very nice.

Votes

Translate

Translate

Report

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 ,
Jul 12, 2019 Jul 12, 2019

Copy link to clipboard

Copied

Thank you!

Were you trying to inline JS or read a file? The -s flag is for inlined JavaScript, the -r flag is for JavaScript files.

Votes

Translate

Translate

Report

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 ,
Jul 14, 2019 Jul 14, 2019

Copy link to clipboard

Copied

I am no longer even worrying about it.  I am now trying to figure out how to mass render AE Projects into H.264.  Without using AME watch folders.  I need to be able to render multiple videos simultaneously.  I need H.264 because the file size needs to be small from the beginning.

Gotta say, not happy (like many many others) about the H.264 going away from AE. 

Thanks again for all of the guidance.

Votes

Translate

Translate

Report

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 Beginner ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

LATEST

Hey Brad, just found this thread but if you're still looking for a solve then try Dataclays Templater plugin for AE, seriously powerful!

Votes

Translate

Translate

Report

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