Subject: Re: Setting SPARKYHOME on Mac
From: michellelynngill
Date: Mar 8, 2010

Previous: 648

Hi Blanton,

An addendum to what Tom has written since Ive spent some time looking at this recently...

I also like to set SPARKYHOME dynamically when I open the program and have a wrapper script which sets pwd to SPARKYHOME (among other environment variables) when I launch Sparky from the command line. Ive put this script into my path so I dont have to type out the rather lengthy path to the actual Sparky executable each time.

If youre fond of using the open command on the Mac and are having problems getting the program to understand SPARKYHOME, you could probably modify the Sparky startup script in /Applications/Sparky.app/Contents/MacOS/sparky to read in pwd. I never got around to trying this though.

The problem with double clicking on the Sparky icon is that theres no easy way to feed it the current directory as SPARKYHOME. I think Mac applications read from ~/MacOSX/environment.plist when they start--Tom can probably confirm this. If your shell keeps track of your directory history (I have mine configured to do so), you may be able to rig something up so that environment.plist gets your most recent directory. Note that this will fail in situations where you have multiple shells open and have changed directories in a different shell at a later time.

Hope this helps,
Michelle Gill

--------------------------------
Michelle L. Gill, Ph.D.
NIH Postdoctoral Research Fellow
Columbia University Medical Center
Department of Biochemistry & Molecular Biophysics
New York, NY 10032


--- In nmr_sparky@yahoogroups.com , Tom Goddard goddard@... wrote:

Hi Blanton,

How are you starting Sparky? Do you double click the icon, or do you
run from a terminal

/Applications/Sparky.app/Contents/MacOS/sparky

or do you use the terminal open command? I suspect you will have to
start from a terminal using the actual executable path, or Sparky wont
get your environment variables.

Tom

Hi,

When I set the SPARKYHOME environment variable from the command line
in terminal to point to my current working directory, and launch
sparky, I still receive a prompt to create the lists, save, and
project directories in my home directory. However, If I include the
setenv variable in my .cshrc script everything works fine. I have
multiple projects and would like to have the setenv SPARKYHOME
included as part of my .alias file but cant seem to get things to
work just from the command line. Any insight you can provided would
be greatly appreciated.

Thanks,
Blanton

================================
Blanton Tolbert
Assistant Professor
Department of Chemistry & Biochemistry
232 Hughes Laboratories
Miami University
Oxford, OH 45056
================================