ArgumentError: Error #3214: NativeProcessStartupInfo.executable does not specify a valid executable file.
The path to the executable is incorrect.
var file:File = File.applicationDirectory.resolvePath("usr/bin/osascript");
The path above is incorrect because of the missing initial “/”. The correct path should be:
var file:File = File.applicationDirectory.resolvePath("/usr/bin/osascript");
Find the correct path to the file or files.
You can use the whereis command in the Terminal to see the path to where a command is located (if it’s the file your looking for).
For example, whereis osascript returns “usr/bin/oascript” source.
Also, check the file.nativePath property to see the directory where the incorrect file is resolving to.