Hello,
Is there a quick way to execute a unix shell app on mac os from within javascript?
Basically, have an applescript that is called by "osascript". I want to be able to call the the osascript from PS javascript.
Thanks,
Raphael
Calling a unix shell app from PS javascript
Calling a unix shell app from PS javascript
It would depend on your version of Photoshop
Lookup, File.execute(); or if on CS4 system();
Lookup, File.execute(); or if on CS4 system();
Calling a unix shell app from PS javascript
On OS X, you have to create a shell script with executable permissions _before_ you run your jsx. It doesn't matter what's in the file. In jsx, you do something like this:
Code: Select all var script = new File("~/Desktop/myscript.sh");
script.length = 0;
script.lineFeed = "unix";
script.length = 0;
script.open("e");
script.writeln("#!/bin/bash");
script.writeln("osascript ... whatever");
script.close();
script.execute();
-X
Code: Select all var script = new File("~/Desktop/myscript.sh");
script.length = 0;
script.lineFeed = "unix";
script.length = 0;
script.open("e");
script.writeln("#!/bin/bash");
script.writeln("osascript ... whatever");
script.close();
script.execute();
-X
Calling a unix shell app from PS javascript
Thanks folks! I have the file.execute working on CS4...could not get the system () to work, but I'm good.
BTW, I had to use some of the Xbytor setup to create the file object before call the fileObj.execute.
Thanks,
Raphael
BTW, I had to use some of the Xbytor setup to create the file object before call the fileObj.execute.
Thanks,
Raphael