Re: tell application "<some application>" to quit...
Re: tell application "<some application>" to quit...
- Subject: Re: tell application "<some application>" to quit...
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 01 Sep 2001 09:27:40 -0700
On 9/1/01 10:12 AM, "Bob.Kalbaugh" <email@hidden> wrote:
>
Is there *one* method for quitting *all* apps in an open, unsaved documents
>
situation?
>
>
Thanks for answering any of the above. My guesses are:
>
Developers' discretion, yes, and no. I hope I've got 'em all wrong.
Why not do this? This should work in most scriptable apps, but you really do
need to check their dictionaries to see if they have 'window'.
tell app "whatever"
activate -- for those that need it
set n to (count windows)
repeat with i from n to 1 by -1
set theWindow to window i
close theWindow saving no
end repeat
quit
end tell
Since they _won't_ all have windows, I guess you'd better do this:
tell app "whatever"
activate -- for those that need it
try
set n to (count windows)
repeat with i from n to 1 by -1
set theWindow to window i
close theWindow saving no
end repeat
on error
beep 3 -- get your attention for the next command!
end try
quit
end tell
--
Paul Berkowitz