Are you having a specific difficulty? When the scripts run they inheret any variables from the shell just as one would expect.
Joined: Jun 19, 2003
That is what I thought as well. ApplrScript seems to be of a different mind.
Background: I know nothing about AppleScript. I usually start and stop Tomact using a simple script. Works with no problems. I read the initial post in this thread and by pure coincidence later that day I went to the homepage of the Spring framework. They have a page on how to get Spring running on an MacOSX system. The page included instructions on creating an AppleScript to start and stop Tomcat.
I opened Script Editor and entered 'do shell script "echo /usr/local/tomcat/jakarta-tomcat-4.1.27/bin/shutdown.sh | /bin/bash"' in the editor and compiled it. I ran the compiled script and it generated an error. The error is: "The JAVA_HOME environment variable is not defined This environment variable is needed to run this program".
I am sure there is a simple way to do it. The variable is defined in my .bash_profile. The command 'echo $JAVA_HOME' prints the correct answer.
It might be interesting to solve this riddle, but I am not to worried as I use CLI for most of this anyway.
You might also want to investigate Platypus for OS X, a tool that creates application wrappers for shell scripts.
We've been trying to use Platypus on a shell script that requires sudo privileges, but it hangs on the sudo. According to someone else who ran into the same thing ( their story) we can't use Platypus to pass in the sudoer's password. Have you come up against this at all? Any tips?