• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Air NativeProcess space issue - starting terminal and passing arguments

Community Beginner ,
Mar 20, 2019 Mar 20, 2019

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?

TOPICS
Development

Views

658

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 20, 2019 Mar 20, 2019

Copy link to clipboard

Copied

What's wrong with a batch file? That's literally the easiest solution.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 20, 2019 Mar 20, 2019

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));

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 22, 2019 Mar 22, 2019

Copy link to clipboard

Copied

LATEST

Thank you very much. I found a way but will try your code as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines