# End Program

Discussion in 'Mac Programming' started by mrsmitty13, Aug 21, 2007.

1. ### mrsmitty13 macrumors newbie

Joined:
Aug 17, 2007
#1
Ok there may be a simple answer out there that I am overlooking but help with this would be awsome. Is there a simple way with applescript to end a program? I've found a way to start one but I dont know how to end the program using the script. What i'm trying to accomplish is via mail have certain commands that will start\end a certain program. Thanks for the help!

2. ### kainjow Moderator emeritus

Joined:
Jun 15, 2000
#2
The safe way (similar to File > Quit):
Code:
tell application "TextEdit" to quit
The less safe way (similar to force quit):
Code:
do shell script "killall TextEdit"

3. ### mrsmitty13 thread starter macrumors newbie

Joined:
Aug 17, 2007
#3
Thank you very much ill give it a try when i get home!

By the way do you know of any good websites out there that teach you some simple apple script commands? I'm new to this and wanna learn.

Joined:
Nov 3, 2005
Location:
UK
5. ### mrsmitty13 thread starter macrumors newbie

Joined:
Aug 17, 2007
#5
That is exactly what I need! THANK YOU SO MUCH!!! Both of you!