Re: ps2pdf -->strange behavior
Re: ps2pdf -->strange behavior
- Subject: Re: ps2pdf -->strange behavior
- From: Bastiaan Boertien <email@hidden>
- Date: Mon, 17 Jan 2005 09:39:13 +0100
Hello, List.
Thanks Rick and Barry, without your reply this solution would never cross my mind.
Your replies helped me a lot. The only thing I also needed to do was to change the ps2pdf, ps2pdf13 and ps2pdfwr.
If you open these files with a text editor you will see that these file runs other files and so on till ghostscript /usr/local/bin/gs
What did I do to run ghostscrip in the terminal and in do shell from applescript
--the bold text is what I changed
open terminal
type commands in terminal
su
pico /usr/local/bin/ps2pdf --same for ps2pdf13,ps2pdf14 and so on
#!/bin/sh
# $Id: ps2pdf13,v 1.3 2002/02/21 21:49:28 giles Exp $
# Convert PostScript to PDF 1.3 (Acrobat 4-and-later compatible).
exec
/usr/local/bin/ps2pdfwr -dCompatibilityLevel=1.3 "$@"
quit
pico /usr/local/bin/ps2pdfwr
#!/bin/sh
# $Id: ps2pdfwr,v 1.10 2004/08/04 00:55:46 giles Exp $
# Convert PostScript to PDF without specifying CompatibilityLevel.
# This definition is changed on install to match the
# executable name set in the makefile
GS_EXECUTABLE=
/usr/local/bin/gs
OPTIONS="-dSAFER"
while true
do
and the rest of the file
quit
Maybe it is helpfull for somebody else
Greetings,
Bastiaan Boertien
Op 14-jan-05 om 18:15 heeft Richard Smykla het volgende geschreven:
Bastiann,
I think you misunderstood Barry's reply. You probably need to specify the full path of the ps2pdf executable; something like:
do shell script "cd " & (POSIX path of theFolder) & "; /usr/local/bin/ps2pdf -r72 " &
(PSFile) & " " & (PDFFile)
Rick
Op 14-jan-05 om 15:32 heeft Barry Wainwright het volgende geschreven:
On 14/1/05 2:15 pm, "Bastiaan Boertien" <email@hidden>
wrote:
Hello list
I've installed Ghostscript on my PowerBook to make a PDF file from a
postscript file from quark.
If I do this:
set theFolder to POSIX path of "Macintosh HD:"
set PSFile to "<thefile>.ps"
set PDFFile to "<thefile>.pdf"
do shell script "cd " & (POSIX path of theFolder) & "; ps2pdf -r72 " &
(PSFile) & " " & (PDFFile)
then the script will return this:
tell current application
do shell script "cd /; ps2pdf -r72 <thefile>.ps <thefile>.pdf"
"sh: line 1: ps2pdf: command not found"
When I copy "cd /; ps2pdf -r72 <thefile>.ps <thefile>.pdf" and paste it in a
new terminal window, ps2pdf will work and i will get an pdf.
Does anyone know this problem? Or know how to solve this problem?
Greetings Bastiaan
'do shell script' uses a different shell to the terminal. It is likely that
these two shells have different $PATH variables set up. Easiest bet is to
call the script with the full path of ps2pdf.
--
Barry
Hello Barry and list
I have already tried it like this:
set PSFile to POSIX path of "Macintosh HD:<thefile>.ps"
set PDFFile to POSIX path of "Macintosh HD:<thefile>.pdf"
do shell script "ps2pdf -r72 " & (PSFile) & " " & (PDFFile)
and still the same error
tell current application
do shell script "ps2pdf -r72 /<thefile>.ps /<thefile>.pdf"
"sh: line 1: ps2pdf: command not found"
When I put a wrong input file it will return "No such file or directory" so I don't think that the shell fail because of the path.
Greetings Bastiaan
--
Rick Smykla
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden