Making the Staden applications clickable in MacOS X

I have installed Staden on MacOS X and have been playing around with it. I used the ebiotools package created by Anders Nisters described in issue 10/1 of the embnet.news for the installation. It works, although not according to the Mac philosophy:

  1. First you have to start Apples own X windows implementation (X11)
  2. Open Apples terminal application (because shell scripts cannot be launched by clicking from the GUI)
  3. Type in the command to start any of the Staden programs

After realizing that e.g. /usr/local/staden-linux-rel-1-4/linux-bin/trev is actually a shell script I added two lines to its beginning to start Apple's X11 and to set the DISPLAY correctly. This is one step less for launching. Then I started to wrap this shell script into cocoa (that's what you need to make it work from the GUI), but this is where it broke. There are a few free applications that wrap shell scripts into cocoa (e.g. Platypus) but I had no success with any of them. In theory they create a clickable and even dropable cocoa application out scripts (including shell and tcl scripts), but they didn't live up to their promises yet. But I am working on it because 5 people in my lab are waiting for that... I have identified two problems:

  1. The wrapper application created from the shell script contains the unmodified version of the script as a Resource. However, it is in a different directory compared to the original script. This means that when the original script uses relative paths, the wrapper will be broken. I have been modifying the shell script /usr/ebiotools/staden/macosx-bin/trev and created a Platypus wrapper in the same directory called trev_wrapper.app. To fix the relative path problem I just replaced trev_wrapper.app/Contents/Resources/script by a symbolic link to the original script ln -s ../../../trev
  2. Secondly environment parameters have to be set explicitely in the beginning of the script. The PATH environment variable gets set correctly if you start a terminal in MacOS X, but not when the wrapper application starts (maybe because the shell script uses sh and not tcsh as MacOS X terminal.app does by default?) So I set the PATH variable explicitly in the beginning of the trev script. This is not a good idea, but just for the prove of principle that it works when the PATHs are correct. And indeed the wrapper started working
  3. I tried to use Platypus "make dropable" option, but platypus always crashes when this option is selected, even with very simple shell scripts. I tried another application to create a dropable wrapper: DropScript. This application indeed creates a droppable cocoa script! However, when you click its cocoa icon it doesn't start up the application without file, but just opens a cocoa applications from which you can open files (and after you have done that, it launches the staden apllication). I might figure out how the DropScript-created cocoa wrapper makes itself droppable and one could transfer this feature to the Platypus wrapper.