'keystroke "." using command down' does nothing!

if name of theObject is "cancelAction" then
	close panel (window of theObject)
	tell application "System Events"
		tell process "Terminal"
			keystroke "." using command down
		end tell
	end tell
end if

i have this code attached to a buttons ‘on clicked’ handler and when i click it the terminal ignores it i guess, because it doesn’t stop the active process in the terminal…am i doing something wrong?

You may need to make the Terminal active (and allow it time to come to the front) before you issue the keystroke command.

Jon

Your better bet is to GREP for the process that is running and do a shell script to kill the PID.

I noticed that sending to TERMINAL doesn’t always send to the active window. It starts a background process that doesn’t do much for you (in your case).