Recently I needed to set some environment variables for a little project I was doing in BBEdit. Aqua applications do not really care about whatever shell I use in the terminal, so they do not read my login files.
Mac OS X does; however, read the ~/.MacOSX/environment.plist file when I log into my account. That environment is available to all applications.
Since I do not like to maintain the same information in two places, I made a short script to turn my shell environment into my environment.plist. I added a short function to Mac::PropertyList to turn a simple hash into a plist (I have not fully implemented the pieces to turn an arbitrary data structure into a plist, though).
#!/usr/bin/perl
use Mac::PropertyList;
print Mac::PropertyList::create_from_hash( \%ENV )
POP_USER comdog HISTFILESIZE 3000 RSYNC_RSH /usr/bin/ssh -l comdog PWD /Users/brian/Desktop CVSROOT /Users/brian/.cvs HOST g3.home.staceytappan.com EDITOR /usr/bin/vi PATH /bin:/usr/bin:/sbin SHELL /usr/local/bin/bash CVS_RSH ssh USER brian HOME /Users/brian