• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: tell application "<some application>" to quit...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tell application "<some application>" to quit...


  • Subject: Re: tell application "<some application>" to quit...
  • From: Emmanuel <email@hidden>
  • Date: Sun, 2 Sep 2001 11:58:03 +0200

At 18:27 +0200 1/09/01, Paul Berkowitz wrote:

> 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

In fact, it would be more advisable to be still more prudent.

It can happen that when you close a given window, some other window[s] get
closed automatically. "close" can decrement the number of windows by more
than one. Your proposition would leave some windows opened.

It might be better to 1. build the list of the windows, 2. try gently to
close each one.

----------------- much tested ...
tell app "whatever"
repeat with theWind in (every window as list)
set theWind to contents of theWind
try
tell theWind to close it saving no
end try
end repeat
end
-----------------

Emmanuel


  • Follow-Ups:
    • Re: tell application "<some application>" to quit...
      • From: "Bob.Kalbaugh" <email@hidden>
References: 
 >tell application "<some application>" to quit... (From: "Bob.Kalbaugh" <email@hidden>)
 >Re: tell application "<some application>" to quit... (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Palm Desktop
  • Next by Date: Re: TIDs ahoy (was Re: coercing a list)
  • Previous by thread: Re: tell application "<some application>" to quit...
  • Next by thread: Re: tell application "<some application>" to quit...
  • Index(es):
    • Date
    • Thread