Highlighted

Execute NativeProcess

Adobe Community Professional ,
Oct 01, 2019

Copy link to clipboard

Copied

I have a Mac OSX AIR desktop app and would like to launch an AppleScript saved as an App using NativeProcess.

 

Here's the code:

var mailScript:File = File.applicationStorageDirectory.resolvePath("scripts/SendMail");

var scriptStartup:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var scriptProcess:NativeProcess = new NativeProcess();
scriptStartup.executable = mailScript;
//scriptProcess.start(scriptStartup);

trace(mailScript.nativePath); //returns the path to the AppleScript App
trace(NativeProcess.isSupported); //Returns true

 

The executable line throws an error: Error #3214: NativeProcessStartupInfo.executable does not specify a valid executable file.

 

Is it possible to start an AppleScript saved as an application? It shows as a process in Activity Monitor.

The documentation has this note. I'm using the path to the app file—not sure what they mean by full path to the executable:

Note: On Mac OS, to launch an executable within an application bundle, be sure to have the path of the File object include the full path to the executable (within the bundle), not just the path to the app file.  

 

 

 

 

Views

54

Likes

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

Execute NativeProcess

Adobe Community Professional ,
Oct 01, 2019

Copy link to clipboard

Copied

I have a Mac OSX AIR desktop app and would like to launch an AppleScript saved as an App using NativeProcess.

 

Here's the code:

var mailScript:File = File.applicationStorageDirectory.resolvePath("scripts/SendMail");

var scriptStartup:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var scriptProcess:NativeProcess = new NativeProcess();
scriptStartup.executable = mailScript;
//scriptProcess.start(scriptStartup);

trace(mailScript.nativePath); //returns the path to the AppleScript App
trace(NativeProcess.isSupported); //Returns true

 

The executable line throws an error: Error #3214: NativeProcessStartupInfo.executable does not specify a valid executable file.

 

Is it possible to start an AppleScript saved as an application? It shows as a process in Activity Monitor.

The documentation has this note. I'm using the path to the app file—not sure what they mean by full path to the executable:

Note: On Mac OS, to launch an executable within an application bundle, be sure to have the path of the File object include the full path to the executable (within the bundle), not just the path to the app file.  

 

 

 

 

Views

55

Likes

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
Oct 01, 2019 0
rob day LATEST
Adobe Community Professional ,
Oct 01, 2019

Copy link to clipboard

Copied

Figured it out, it was the path. I had to drill down into the app package—this worked:

 

var mailScript:File = File.applicationStorageDirectory.resolvePath("scripts/SendMail.app/Contents/MacOS/applet");

Likes

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
Reply
Loading...
Oct 01, 2019 1