Command Not Found problem

When I use “do shell script” command in applescript to launch an application i get command not found errors for the application but when i run the exact same command in my shell it works fine? Any ideas?

hi mes,

post the code, otherwise you are just asking for the best guess.

all the shell script is is a command to open a program called paraprof which is in the permanent PATH…well i can type paraprof in the shell and the program opens, however, when i go to applescript and type do shell script “paraprof” i get a command not found error.

also, i recently restored my /etc/profile from a backup after making some changes to it, it is back to the original now, but do i need to do anything to get programs outside of the shell to associate with the profile again?

Scripts probably aren’t aware of the shell environment. You can find the path within Terminal by typing “type paraprof”. Then specify the full path like

do shell script “/usr/local/bin/paraprof”

hi mes,

guyen is correct, but here are more details:

“do shell script”, uses /bin/sh, not /bin/bash, and will not use your .bash_profile.

if you don’t code your shell script to use a specific path, you cannot predict what the results of your script will be. will it use a builtin? will it use another, more limited version of a program? will it not find the program? here’s what Apple has to say:

http://developer.apple.com/technotes/tn2002/tn2065.html

EDITED: to quote.

hey thanks a lot that worked, sorry im kind of new to applescript and such