Is it possible to execute JSX scripts from outside ExtendScript?

Viewed 32965

Typically when you're writing a .jsx script to automate an Adobe product (like InDesign, Illustrator or Photoshop), you write, debug and execute the script from the ExtendScript IDE. Is it possible to bypass ExtendScript and run the script from a third program?

I think Adobe products have a built-in JavaScript interpreter which ExtendScript can connect to to access the Adobe object models and automate their software. I'd like to be able to connect directly to that interpreter and run jsx files just as I would in ExtendScript.

7 Answers

If you place the .jsx files in the right location

Photoshop
folder location:
/Applications/Adobe\ Photoshop\ CS5/Presets/Scripts
menu location:
File > Scripts

Illustrator
folder location:
/Applications/Adobe\ Illustrator\ CS5/Presets.localized/en_GB/Scripts
menu location:
File > Scripts

InDesign
folder location:
/Users/{user}/Library/Preferences/Adobe\ InDesign/Version\ 7.0/en_GB/Scripts/Scripts\ Panel
menu location:
Window > Utilities > Scripts

These are the paths on OSX, it should be easy to find the equivalent on Windows for Photoshop and Illustrator, but for InDesign it might be easier to open the Scripts Panel and open the scripts folder using the Panel's context menu.

I know that you can run .jsfl scripts from the command line by opening Flash and passing the path to the .jsfl script as an argument, but that doesn't seem to work for .jsx files with InDesign.

HTH

This question is quite old. I am going to answer this on the assumption that:

  1. You're running JSX scripts for after effects.
  2. You're using Windows.

I'm not sure whether you want to pass arguments to a script (in which case my simple solution won't work, or might need nasty workarounds).

Fortunately there is an easy way to do this with after effects. You can launch cmd and type the following command:

afterfx -r C:/Users/me/myscript.jsx

If afterfx isn't recognized, you'll need to add the after effects installation path to Path in your System Variables. I'm not aware of the availability of this feature in other Adobe programs. For more information about running your after effects scripts from the command line, you can consult: https://helpx.adobe.com/after-effects/using/scripts.html

You can use extend script to run it . there is a free extension on creative cloud will help you to run scripts fast in illustrator , aftereffects, photoshop and premiere pro you can find it on adobe exchange ( liveview )

Related