title: Quit an applescript application after the execution of a shell script
body: <p>I was wondering if it is possible for an applescript application to run a shell script, then quit before the execution of the shell script is completed. This would be useful when running a server for a given amount of time. Instead of needing the applescript to be constantly running in the background, is there any way to run a function independently?</p>
  
  <pre><code>set server_name to text returned of (display dialog "Choose server." default answer "")
  set success to do shell script "if [ -f \"/Users/jessefrohlich/Documents/Minecraft/" &amp; server_name &amp; "/minecraft_server.jar\" ]; then
      echo 1;
  else
      echo 0;
  fi"
  if success is equal to "1" then
      do shell script "cd /Users/jessefrohlich/Documents/Minecraft/" &amp; server_name &amp; "
      java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
  else
      display dialog "Sorry, the file you chose is invalid."
  end if
  </code></pre>
  
  <p>When the above is run as an application, it will launch the server properly. However, the application <code>runScript.app</code> will continue to run. The server will keep running even if the applescript is force quit. Is there any way to have it quit automatically, as soon as the server is launched?</p>
  
  <p>Thanks</p>