title: How to end an AppleScript Process
body: <p>Basically, what I want to do is have a window open in the top right corner when the script is started, and you can click the button in the dialogue which will end the process.</p>
  
  <p>I have no idea how to do this, because I'm new to AppleScript.
  I have tried this:</p>
  
  <pre><code>display dialogue "Here is where you can end the process.."
  buttons {"End Process"}
  copy the result as list to {text_returned, button_pressed}
  if button_pressed contains "End Process" then
  tell application Spammer
  end process
  end tell
  </code></pre>
  
  <p>Help is appreciated! Thanks!</p>