Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Include paths in AppleScript shell commands UNIX
Many people have trouble when doing a shell script through applescript even when the shell script works perfectly in the Terminal. A common problem is that the command that you're using with "Do shell script" works in the Terminal (tcsh for most) but doesn't work with zsh that applescript uses when you invoke "Do shell script". To get the command to work , you have to specify the pathway to the command for the applescript to be able to use it.

To get the pathway to a command, simply type "which " and the command while in the Terminal. Then press "return." For example:
 % which chown
Gives you /usr/sbin/chown as output.

So in the AppleScript, don't type do shell script "chown etc...". Instead, type do shell script "/usr/sbin/chown etc...". Now it works, yay! :)
  • Currently 3.50 / 5
  You rated: 5 / 5 (2 votes cast)

Include paths in AppleScript shell commands | 1 comments | Create New Account
Click here to return to the 'Include paths in AppleScript shell commands' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Include paths in AppleScript shell commands
Authored by: kyrrigle on Jan 21, '04 09:53:51AM

just ran into this hint via google... also found the Apple developer doc that goes into more detail:


[ Reply to This | # ]