• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Do Shell Script returns empty string but works in Terminal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Do Shell Script returns empty string but works in Terminal
      • From: Bob Stern <email@hidden>
    • Re: Do Shell Script returns empty string but works in Terminal
      • From: Andrew Oliver <email@hidden>
References: 
 >Do Shell Script returns empty string but works in Terminal (From: Bob Stern <email@hidden>)

  • Prev by Date: Re: Position of an element in a list
  • Next by Date: Re: Do Shell Script returns empty string but works in Terminal
  • Previous by thread: Do Shell Script returns empty string but works in Terminal
  • Next by thread: Re: Do Shell Script returns empty string but works in Terminal
  • Index(es):
    • Date
    • Thread