Skip to main content
Participating Frequently
April 12, 2019
Answered

Is it possible to run jsx script without GUI on macOS.

  • April 12, 2019
  • 2 replies
  • 5466 views

In the windows OS, it is possible to run the external jsx script using afterfx.exe without opening the GUI.

But in the macOS, I can't find the way to run the jsx script without GUI.

Some articles suggest to do like following, but it is really noui and it opens a small AE GUI.

open -n -a 'Adobe After Effects CC 2018.app' --args -noui

osascript -e 'tell application "Adobe After Effects CC 2018" to activate' -e 'tell application "Adobe After Effects CC 2018" to DoScriptFile "jsx file path"'

Using this, i can run the jsx script, but when i call above command for several jsx and several ae project at a same time, the GUI randomly crash or become not responding.

Is there any other way to run the jsx script without GUI or prevent to crash the GUI by running several jsx script?

I want only MacOS.

Please help if you have any idea.

Thank you.

[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]

[Moved from generic Cloud/Setup forum to the specific Program forum... Mod]

This topic has been closed for replies.
Correct answer Justin Taylor-Hyper Brew

By CLI flags, I was referring to what you were trying that doesn't work well on macs (-s, -m, -noui).

What I've done for headless stuff like this is create an invisible extension or a script in the script startup folder that checks if app.isUISuppressed() === true before proceeding. Note that the UI is also suppressed when aerendercore is running as an AE instance in Premiere Pro (for dynamic links or MOGRTS) and when rendering AE comps in AME. That's why I like the extension method better so I can check the PID against the app that I launched to make sure it's the correct instance.

You could also just create a script, put it in the startup folder, and then remove it soon as you're done. This way other instances won't see it.

Anyway, aerendercore is great because it's really stable for opening / closing multiple projects and it's truly headless, unlike using the -noui flag with AE. It's a bit tricky to get setup as there's no documentation for it, but it basically runs the same as AE.

2 replies

Justin Taylor-Hyper Brew
Community Expert
Community Expert
April 19, 2019

Use app.quit()  once you’re done with that instance. There’s no way to make it fully stable, some stuff can just go wrong. My workaround was to kill The process by PID from the command line if it didn’t respond after a certain amount of time. And then spin up another instance and redo that operation. Also, make sure you’re not running too many instances, as it can max out your RAM and CPU and cause more issues. I think I set the limit at three instances at one time, but my tool is still very much in development, and I haven’t looked at it for a while...  hope that helps.

Participant
April 7, 2020

Hi Justintaylor, ginap63921136,

 

I got the same problem when I tried to run multiple instance of aerendercore at the same time.

When I run two aerender instance to generate video, I can see it create two instances of aerendercore. But I can not run two instances of aerendercore by using osascript.

I want to run multiple jsx files at the same time.

Do you knwo anyway to achieve this?

Thank you very much!

Justin Taylor-Hyper Brew
Community Expert
Community Expert
April 12, 2019

Don't use the -noui flag for more than one project, I've found it to be very unstable. And the CLI flags should work, but on MacOS I've also found them to be unreliable. Use the aerendercore instead:

/Applications/Adobe After Effects CC 2019/Adobe After Effects CC 2019.app/Contents/aerendercore.app/Contents/MacOS/aerendercore

You can then run scripts with osascript, startup script, or with an invisible extension.

Participating Frequently
April 13, 2019

Hi, justintaylor.

Thank you for your response.

Could you please explain in more detail how to use CLS flag and aerendercore?

Justin Taylor-Hyper Brew
Community Expert
Community Expert
April 13, 2019

By CLI flags, I was referring to what you were trying that doesn't work well on macs (-s, -m, -noui).

What I've done for headless stuff like this is create an invisible extension or a script in the script startup folder that checks if app.isUISuppressed() === true before proceeding. Note that the UI is also suppressed when aerendercore is running as an AE instance in Premiere Pro (for dynamic links or MOGRTS) and when rendering AE comps in AME. That's why I like the extension method better so I can check the PID against the app that I launched to make sure it's the correct instance.

You could also just create a script, put it in the startup folder, and then remove it soon as you're done. This way other instances won't see it.

Anyway, aerendercore is great because it's really stable for opening / closing multiple projects and it's truly headless, unlike using the -noui flag with AE. It's a bit tricky to get setup as there's no documentation for it, but it basically runs the same as AE.