Stopping (quitting) a script ran with osascript?

This might be a fairly simple one, if it has been covered before I apologize-

I’m using a script to install Office 2008 across my company. I’ve written a script that works pretty well, but I just need one easy fix. The first part of my script checks to see if Microsoft Word 2008 exists. If it does, I need my script to stop here, and not progress. Here’s my example-

if exists “Macintosh HD:Applications:Microsoft Office 2008:Microsoft” then
do shell script “echo Microsoft Office 2008 is already installed. > $HOME/Desktop/Install\ Complete.txt”
end if

Before the end if, I need to tell the script to stop running. I thought about inputting a ‘quit’, but when I run the script with osascript via command line, I get the message that osascript doesn’t understand the quit message. What’s the best way to make the script stop running if Word 2008 exists?


normally an error -128 oder return (on the top level of the script) aborts a script.
Quit is only used in application scripts

Worked great! Thank you!