>We have been testing imageborder with very good results from the command
>line. But I can't get it to work from a do shell script in applescript.
>This works      do shell script "/opt/local/bin/identify /test44.jpg"
>This doesn't    do shell script "/opt/local/bin/imageborder /test44.jpg
>/test44out.jpg"
>FILE   /test44.jpg   NOT READABLE OR HAS ZERO SIZE   --NOTE: same file
>works with 'identify'
>
>This works in terminal
>$imageborder /test44.jpg /test44out.jpg
>
>As does this
>$/opt/local/bin/imageborder /test44.jpg /test44out.jpg
>
>Anyone have any troubleshooting tips? I'm out of ideas.
>Thanks for any help.
>Mark


Hello Mark,

I presume imageborder is my bash script from 
http://www.fmwconcepts.com/imagemagick/index.html

I have not tried my scripts from Applescript. All I can think of is 
to try giving the full path to the images (from root) as well as the 
full path to the script.

As the script works from the terminal, then it must have something to 
do with Applescript and any requirements or special permissions, etc.

Perhaps it has something to do with the script being installed in the 
MacPorts folder /opt. Have you tried moving the script to the same 
location as your images?

I just tried:

do shell script 
"/Users/fred/Applications/ImageMagick-Scripts/bin/imageborder 
/Users/fred/zelda3.png /Users/fred/zelda3_tmp.png"

and get the same kind of error message. I have never used Applescript 
to run any of my shell scripts before so have no experience with this 
kind of error.

That error message is coming from the first convert command in the 
script to read the image into a temp IM file:

# read the input image into the TMP cached image.
convert -quiet -regard-warnings "$infile" +repage "$tmpA" ||
   errMsg "--- FILE $infile NOT READABLE OR HAS ZERO SIZE ---"

OK, I figured it out. Apparently Applescript cannot find convert 
automatically (unless someone knows how to modify your environment to 
tell it how) and I don't know how to do that. If you know, please 
inform me.

So to get around it. Go into the script and edit it to change convert 
to fullpathto/convert, which in your case appears to be 
/opt/local/bin/convert.

I just edited my version with /usr/local/bin/convert everywhere in 
the script (8 places) and it works fine now for me.


Fred
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to