What's the difference between LC 'shell' and OSX terminal?

Andre Garzia andre at andregarzia.com
Fri Oct 28 16:09:34 EDT 2011


Graham,

This is probably a PATH issue. See when you launch your terminal, a bash
script is executed. You can think of this script as the code in
preOpenTerminal. Among other things, this script will set the PATH variable
which holds a list of folders to look for commands in. So when you use the
"convert" command, bash (which is the shell you are using in your terminal)
will look inside those folders for a convert command. When you execute
shell() on your LiveCode script, this bash initialization stuff is not run
so the PATH variable will hold other things and there is a chance that the
folder where imagemagick is installed is not there.

Try this on your terminal:

which convert

This will return the path to the convert command, in my case is:

/usr/local/bin/convert

So change your convert command in the shell to "/usr/local/bin/convert
image.jpg blabla" and see if you can get it to work.

(I may of course be wrong and the problem may lie elsewhere)

Andre

On Fri, Oct 28, 2011 at 2:52 PM, Graham Samuel <livfoss at mac.com> wrote:

> While trying to get just a bit comfortable with a command-line interface, I
> started Terminal on Mac OSX Lion and eventually got a command to work (after
> finding out how to cope with spaces in file and folder names). I put the
> same thing in an LC 'shell' command and got a runtime error (Handler: can't
> find handler). I guess this is because in the Terminal context, the shell
> recognised the program I was calling ('convert' - it's dear old ImageMagick)
> but within my prog and the LS IDE it didn't. What do I need to do to get
> 'my' shell to be able to invoke the same apps that the raw terminal
> interface can? My guess is that it's something to do with a context variable
> like LS's defaultFolder, but I just don't know how to get there. Can anyone
> explain?
>
> TIA
>
> Graham
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.



More information about the use-livecode mailing list