Copy link to clipboard
Copied
The CS6 documentation only explains using system.callSystem to start a .exe on a Windows OS but I'd like to use it to start an a program on a mac. I assume this is poosible but the documentation doesn't document it. What would the syntax be (I'm a windows guy so I've never done a lot of command line work on a mac)
Copy link to clipboard
Copied
It's essentially what's available to you if you were to type in commands at OSX's Terminal. So, you could, for example, use osascript to run an AppleScript that launches an application. It might look like this in ExtendScript code:
system.callSystem('osascript /path/to/an/AppleScript.scpt');
Then, inside the AppleScript you can launch an app. Or, you could invoke scripts written in other languages by simply calling their interpreter, for example like:
system.callSystem('php /path/to/file.php');
Whatever script interpreters you have at your command line you can use directly within a system.callSystem() call.
You can also just write a direct command like:
system.callSystem('echo "Something to a log file" >> /path/to/a/log.txt');
That command would allow your script output log to a file.
Hope that helps,
Arie
Copy link to clipboard
Copied
This template for is for Mac but you can add few lines and it would work on Windos too:
function OpenApp(url){
var cmd;
cmd = "";
if($.os.indexOf("Win") != -1){
cmd = "explorer " + String(url);
}else{
cmd += (("open \"" + String(url)) + "\"");
}
try {
system.callSystem(cmd);
}catch (e){
alert(e);
}
}
OpenApp("-a safari");
// open -a Adobe\ Photoshop\ CS // you can use it for Mac
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more