[crossposted and follow-ups set to <news:alt.comp.lang.applescript>]
In article
<
0001HW.D10FAF72...@news.eternal-september.org>,
Mike Cook <mc...@NOTyahoo.com> wrote:
> I have created a script and saved it as an Application. When I click the Run
> button from within the Script Editor, it executes as expected, no errors.
>
> But if I double-click on the application file I just created I get the
> notice:
>
> "The command exited with a non-zero status," and the script doesn't give
> the result that it should.
Sounds like you're using "do shell script". Make sure to read
<
https://developer.apple.com/library/mac/technotes/tn2065/_index.html>.
Likely culprits are with handling of stdout and stderr, (relative)
paths, privileges and such.
> I would expect this to run just like it did from within the editor.
>
> Why does this script not run?
Depending in part on your OS version, Script Editor may be another
context than the one your applet runs in.[*] That context in turn might
be relevant in yet other ways to "do shell script" itself.
[*] In AS, "me" refers to the script itself. But when run inside Script
Editor, it refers to Script Editor. That is, it used to. Apple changed
that somewhat recently, but I don't recall in when exactly.
--
"-- \n"