Applescript process vs application difference

by dickguertin - 10/22/12 1:30 PM

I'm running MacOSX 10.5.8 on a MacBook-Pro. I'm finding a difference between "process" and "application" that does NOT make sense. Here is my Applescript code snippet:

tell application "Safari"
-- do something, blah, blah blah
end tell
-- now, terminate Safari
tell application "Finder"
repeat while (exists process "Safari")
tell application "Safari" to quit
delay 1
end repeat
end tell

That works, but EITHER or BOTH of the following cause an infinite loop with Safari, or a "Connection is invalid".

1) repeat while (exists application "Safari")
2) tell process "Safari" to quit

With "exists application", or BOTH statements contain "process", this fails in some manner. Why?