terminal troubles

Hi all,

I have installed the PdfToText (which is is part of XPDF)
If I use the Terminal:
$ pdftotext /Users/ldicroce/Desktop/Shi_et_al.pdf
Everything works fine. I can even call the manual information with:
$ man PdftoText

But if I use the applescript command:

do shell script ("pdftotext  /Users/ldicroce/Desktop/Shi_et_al.pdf")

I get an error: “sh: pdftotext: command not found”

But if I use this:

tell application "Terminal" to tell window 1
	do script "pdftotext /Users/ldicroce/Desktop/Shi_et_al.pdf" -- in window 1
end tell

Everything works fine.
I don’t understand it …




Have you tried including the path to the executable file too? eg.:

do shell script ("/path/to/pdftotext /Users/ldicroce/Desktop/Shi_et_al.pdf") -- Replace "/path/to/" with the actual location.

You were right.
If I use:

do shell script ("/usr/local/bin/pdftotext /Users/ldicroce/Desktop/Shi_et_al.pdf")

… then, it works.
Should I have copied the the executable file to a different location?
Thanks a lot !