Copy link to clipboard
Copied
Hello,
I know this has been discussed some times - still I could not figure if there is a way without workaround to pass the arguments. I am on Mac OS X High Sierra.
I am starting Terminal.app with Native Process and need to pass arguments to Terminal.
This is what I am trying to push into the arguments array:
"/usr/bin/automator ~/Desktop/screenium-aut.workflow"
It is working when I am leaving out the args part after the space like this:
"/usr/bin/automator"
Some solution anyone without batch file?
Copy link to clipboard
Copied
What's wrong with a batch file? That's literally the easiest solution.
Copy link to clipboard
Copied
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var file:File = new File("/usr/bin/automator");
nativeProcessStartupInfo.workingDirectory = new File("/usr/bin");
nativeProcessStartupInfo.executable = file;
var processArgs:Vector.<String> = new Vector.<String>();
processArgs.push("-i", "~/Desktop/screenium-aut.workflow");
nativeProcessStartupInfo.arguments = processArgs;
var process:NativeProcess = new NativeProcess();
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
process.start(nativeProcessStartupInfo);
public function onOutputData(event:ProgressEvent):void {
trace(event.target.standardOutput.readUTFBytes(event.target.standardOutput.bytesAvailable));
}
public function onErrorData(event:ProgressEvent):void {
trace(event.target.standardError.readUTFBytes(event.target.standardError.bytesAvailable));
}
Copy link to clipboard
Copied
Thank you very much. I found a way but will try your code as well.