• 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: Works in Terminal, not as "do shell script"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Works in Terminal, not as "do shell script"


  • Subject: Re: Works in Terminal, not as "do shell script"
  • From: Doug McNutt <email@hidden>
  • Date: Sun, 4 Apr 2010 09:34:05 -0600

At 07:34 -0700 4/4/10, Rob Lewis wrote:
Could someone please explain why this works fine in Terminal:

     /usr/bin/which exiftool

returning the correct path: /opt/local/bin/exiftool

while in AppleScript, this:

     do shell script "/usr/bin/which exiftool"

returns: error "The command exited with a non-zero status." number 1

Other shell commands like "ls" work OK.
And this works too:

     do shell script "which which"

returning: "/usr/bin/which"

The exiftool command is installed and works when invoked with /opt/local/bin/exiftool


Almost surely your $PATH variable is not set properly when you use "do shell script".  Apple's default will only provide /bin:/sbin:/user/bin:/user/sbin.  When you open a shell in Terminal.app your shell startup scripts get run and they install the /opt/ and the like.

At login time a file  at  $HOME/.MacOSx/environment.plist will be read and processed if it exists. You can set up a PATH that you like there. A bit of searching on Apples site or Google will find the file format.

--
--> Give me liberty or give me Obamacare <--
 _______________________________________________
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

References: 
 >Works in Terminal, not as "do shell script" (From: Rob Lewis <email@hidden>)

  • Prev by Date: Re: Works in Terminal, not as "do shell script"
  • Next by Date: Re: Move cursor with Applescript
  • Previous by thread: Re: Works in Terminal, not as "do shell script"
  • Next by thread: Re: Works in Terminal, not as "do shell script"
  • Index(es):
    • Date
    • Thread