(* I was looking for a way to interrupt a Terminal Process so I could close the window programmatically. I couldn't figure out how to use AppleScript to click the "Terminate" button when this dialog came up:
"Do you want to terminate running processes in this window? Closing this window will terminate the running process xxxxx."
I found "ASCII character 3" is the Ctrl c equivalent. So "do script (ASCII character 3) in window 1" works to interrupt the process, then the window can be closed. *)

tell application "Terminal"
	set theBusy to busy of window 1
	if theBusy then
		do script (ASCII character 3) in window 1
		delay 3
	end if
	--close window 1 saving no
end tell


-- applescript page