From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Sun Oct 30 2011 - 10:04:09 CDT

On Sun, 2011-10-30 at 21:55 +1000, Anthony Rey wrote:
> Hi all,
>
> I use VMD on a Mac OS X version 10.6.8.
>
> I want to run gedit through my Tcl/Tk console but can't figure out out
> to do it. I made an alias in my .bashrc file and it does work in my
> Terminal:
>
> alias gedit ' /Applications/gedit.app/Contents/MacOS/gedit ';
>
> I thought that I just had to copy this alias into the .vmdrc file to be
> able to run gedit through the Tcl/Tk console....but it doesn't work:

of course not! the syntax in .vmdrc is Tcl syntax
and not bash syntax. how should this work?
if you copy a sentence in written in french into
an english book, it won't become english, either.

>
> I obtain the following error message:
>
> /usr/bin/alias: line 4: alias: gedit: not found
> /usr/bin/alias: line 4: alias: ': not found
> /usr/bin/alias: line 4: alias:
> /Applications/gedit.app/Contents/MacOS/gedit: not found
> /usr/bin/alias: line 4: alias: ': not found
> child process exited abnormally
>
>
> How could I possibly run gedit (as well as other packages such as
> xmtrace etc..) through the Tk/Tcl console in VMD?

you have three options:

1) you don't use an alias but change your PATH
environment variable to include the directory
with gedit in it

2) you write a small wrapper shell script:
#!/bin/sh
exec /Applications/gedit.app/Contents/MacOS/gedit "$@"

and place that in a directory that *is* already
in your PATH

3) you write a small tcl proc that works like
an alias on the VMD/Tcl command prompt. e.g.:

proc gedit {args} {
  exec /Applications/gedit.app/Contents/MacOS/gedit $args &
}

HTH,
    axel
> Thanks very much for your help,
>
> Tony

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com http://goo.gl/1wk0
College of Science and Technology,
Institute for Computational Molecular Science,
Temple University, Philadelphia PA, USA.