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

Executing an ExtendScript file from Mac OS Terminal

Contributor ,
Jul 12, 2016 Jul 12, 2016

There are a lot of flavors of answer to this out there, none of which seem to work for me. Let me say right off the bat that my terminal (I'm running Yosemite) recognizes neither '-cmd' nor '-run' nor '-r'.

So, here is the breakdown:

1. I am able to launch AE from the terminal.

2. I am able to open an AE file from the terminal.

~Here is where it gets tricky~

3. I am able to open ExtendScript Toolkit from the terminal, although I would rather not have to involve this app at all, and just automatically run the script.

4. I am able to open my .jsx file in ExtendScript Toolkit from the terminal, although, again, I would rather not have to open ExtendScript Toolkit at all.

5. I am not able to run the .jsx file from the terminal.

How do I do this? Thanks!

TOPICS
Scripting
3.7K
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

correct answers 1 Correct answer

Community Expert , Jul 14, 2016 Jul 14, 2016

If you execute this in your Mac OS Terminal and replace the "/path/to/my script.jsx" with the location of your script, it should open AE (if it is not yet running) and execute the script.

osascript -e 'tell application "Adobe After Effects CC 2015" to activate' -e 'tell application "Adobe After Effects CC 2015" to DoScriptFile "/path/to/my script.jsx"'

Translate
Contributor ,
Jul 12, 2016 Jul 12, 2016

It looks as though I were missing "#target aftereffects", which now executes the script (not without clunkily giving me a warning prompt about executing scripts from outside AE).

If anyone has experience with/suggestions for executing an extendscript file without having to launch ESTK every time, I would appreciate it. We are able to do this in another extension we wrote, but for some reason it isn't working here.

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

If you execute this in your Mac OS Terminal and replace the "/path/to/my script.jsx" with the location of your script, it should open AE (if it is not yet running) and execute the script.

osascript -e 'tell application "Adobe After Effects CC 2015" to activate' -e 'tell application "Adobe After Effects CC 2015" to DoScriptFile "/path/to/my script.jsx"'

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
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
Contributor ,
Jul 14, 2016 Jul 14, 2016

That worked flawlessly. Thanks so much!

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 ,
Jul 26, 2018 Jul 26, 2018

Does this still work? It should theoretically work with Premiere Pro as well right?
I tried the following and I got a syntax error saying "120:121: syntax error: Expected end of line, etc. but found “"”. (-2741)"

The command was:

osascript -e 'tell application "Adobe Premiere Pro CC 2018" to activate' -e 'tell application "Adobe Premiere Pro CC 2018" to DoScriptFile "/Users/mymac/Desktop/scripts/Test.jsx"'

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 Beginner ,
Aug 31, 2018 Aug 31, 2018

Same here -- I'm trying to trigger Media Encoder from the commandline, and I get the same Error description and code -2741.

This is on Mac OSX 10.10.5 running the CC 2017 suite.

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
Enthusiast ,
Sep 10, 2018 Sep 10, 2018
LATEST

NVIDIA  wrote

Does this still work? It should theoretically work with Premiere Pro as well right?

Try this in Terminal:

/Applications/Adobe\ ExtendScript\ Toolkit\ CC/ExtendScript\ Toolkit.app/Contents/MacOS/ExtendScript\ Toolkit -run /Path/To/ExtendScriptFile.jsx

Same here -- I'm trying to trigger Media Encoder

For AME the same approach didn't work, so try the following JSX (adapted from AME and JSX weird issues )

It targets PPro and uses BridgeTalk to send commands to Media Encoder.

#target premierepro

Bt=new BridgeTalk;

Bt.target="ame";

Bt.body=function(){

  alert("yes it's working");

}.toSource()+"()";

Bt.send();

Tried the following systematically commenting and uncommenting the various targets:

#target premierepro

//#target aftereffects

//#target photoshop

//#target illustrator

//#target indesign

//#target ame

//#target audition

alert("Working!");

PPro, AE, Photoshop, Illustrator, and Indesign all work both from ExtendScript and via Terminal.

AME requires BridgeTalk

Audition does not recognize "alert()" from Terminal, nor did it respond to BridgeTalk (at least for the alert function), nor even from ExtendScript.

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