Page 2 of 2

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-18T21:29:46-07:00
by fmw42
If you want to run a unix shell script from Applescript, then use "do script" and not "do shell script". The latter will not use your PATH and so will not find convert. If you want to use do shell script, then you must provide the full path to convert.

Code: Select all

tell application "Terminal"
	do script "yourscript"
end tell
or

Code: Select all

do shell script "export PATH=/usr/local/bin:$PATH; path2/yourscript"
The former will open the terminal app and run the script, so you will see any progress or errors.

The latter will run in the background and you will not see any progress or errors as far as I have experiences. I use the former.

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T09:24:26-07:00
by fmw42
I assume you edit your delegates.xml file

<delegate decode="pdf" encode="eps" mode="bi" command=""absolutepath2/gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i""/>

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T17:27:37-07:00
by AusS2000
Yes, I tried making the path to gs in delegates.xml absolute.

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T17:31:51-07:00
by AusS2000
I mucked around with permissions on the gs file (actually gs-noX11 as that is the target on the symbolic link 'gs').

It was initially:
root xxx
wheel xxx
everyone xox

I first tried changing 'everyone' to xxx (no joy) then:
wayneirvine xxx
admin xxx
everyone xxx

Still no joy.

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T17:33:52-07:00
by AusS2000
I'd try running gs directly but not sure how much of this is required:

"/usr/local/bin/gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dFirstPage=1 -dLastPage=1 "-sOutputFile=/var/tmp/magick-9241lGGLX0O8AQ74%d" "-f/var/tmp/magick-9241EScvRp4x3xp8" "-f/var/tmp/magick-9241P8JBWLadebba"' (-1)

or how to structure the input and output strings.

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T17:40:27-07:00
by AusS2000
Hmm, tried:
gs -dNOPAUSE -sDEVICE=jpeg -r144 -sOutputFile=/Library/Server/Web/Data/Sites/~bartel/brochures/images/EV-RD-6770-3291.jpg /Library/Server/Web/Data/Sites/~bartel/brochures/files/EV-RD-6770-3291.pdf

From the command line and of course it works. Very confusing

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T17:49:19-07:00
by AusS2000
And bypassing imagemagick and calling gs directly from the script also works.

I realise I can get away with calling gs to go from PDF to JPG and then call imagemagick to resize but I would really like to solve the problem of calling gs from within imagemagick.

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T18:32:36-07:00
by AusS2000
Seems this has moved quite a bit off-topic. I'll move my issue to another thread to save any further confusion.

Re: manually set delegate path to gs (ghostscript)

Posted: 2016-04-19T20:11:36-07:00
by AusS2000