Re: Do Shell Script returns empty string but works in Terminal
Re: Do Shell Script returns empty string but works in Terminal
- Subject: Re: Do Shell Script returns empty string but works in Terminal
- From: Shane Stanley <email@hidden>
- Date: Thu, 3 Aug 2017 15:03:20 +1000
On 3 Aug 2017, at 12:47 pm, Bob Stern <email@hidden> wrote:
>
> The “do shell script” AppleScript does cause the client/server application to
> perform the specified command except that it fails to return a result.
The problem appears to be that the binary is returning the result you want to
standardErr, not standardOut. 'do shell script' ignores standardErr unless the
binary's termination status is other than 0, in which case it uses it for the
error message.
You can work around it by using AppleScriptObjC and NSTask instead of 'do shell
script', as long as it never returns very large amounts of data.
It probably wouldn't hurt to ask the developers why they're doing it this way...
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden