Posted By

layouterlimits on 09/27/12


Tagged

java adobe extendscript cs


Versions (?)

Sending ExtendScript via Java


 / Published in: Java
 

Just a simple code snippet that uses cmd to send an ExtendScript to an application like Photoshop® or InDesign®.

  1. // photoshop's application directory path has been declared as an environment variable - so we don't need the full path here
  2. String app = "photoshop";
  3. String scriptpath = ("c:/script/extendscript/example.jsx").replace('/', '\\');
  4. String[] commands = new String[]{"cmd", "/c", "start", "\"\"", app, scriptpath};
  5. try { Runtime.getRuntime().exec(commands); } catch (IOException e) { e.printStackTrace(); }

Report this snippet  

You need to login to post a comment.