I’m trying to call textoc from OS X Application Alfred as a shell script.

And with Alfred everything seems fine—I already asked the developers but they say that the script should work. When debugging I get the message
21.9.11 17:14:12
[0x0-0x40040].com.alfredapp.Alfred[977]
env: texlua: No such file or directory
therefore I guess it’s a problem with texdoc and not with Alfred.
I get the same error if I call texdoc with an apple script
do shell script "texdoc file"
But when calling texdoc file directly in my Terminal or in not-silent mode of Alfred (which means a terminal window opens and the command is executed) everything works.
A shell script (td.sh)
#!/bin/bash
texdoc $1
called with sh td.sh file works too.
Hope that anyone has an idea how to solve this or at least point where I can get help …
osascript -e 'do shell script "texdoc amsmath"'does what's expected. What's the answer toosascript -e 'do shell script "echo $PATH"'given to the terminal? – egreg Sep 21 '11 at 16:09