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.
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");
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more