• 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: closing all but very specific windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: closing all but very specific windows


  • Subject: Re: closing all but very specific windows
  • From: Nigel Garvey <email@hidden>
  • Date: Thu, 4 Apr 2002 11:51:11 +0100

"Anthony Adachi" wrote on 3 Apr 2002 19:44:15 -0500:

>I made a variant of your snippet which will close all the pop-up folders
>except those that one desires to keep hanging about at the edge of the
>screen.
>
>----
>property items_toKeepOpen_paths : {(alias ((path to startup disk as string)
>& "cF:k2:"))}
>
>
>tell application "Finder"
> activate --Finder must be the frontmost app in order to un_pop a pop up
>window.
> open items_toKeepOpen_paths
> set closure_limit to the (count (result as list))
> set the indexesToClose to the index of (every window where (index of it >
>closure_limit) and (popup of it is true))
> set the popup of (every window where (index of it is in indexesToClose)
>and (popup of it is true)) to false
> close (windows whose index does not come after (count (indexesToClose as
>list)))
>end tell

Nice idea. :-) I haven't tried running this, but your 'close' line seems
to be closing *the first n windows*, where n is the number of popup
windows you want to close whose index comes *after* the windows you
normally want to keep. The first n windows includes at least one that you
want to keep.

If I've understood your aim correctly, this might be better:

tell application "Finder"
activate --Finder must be the frontmost app in order to un_pop a pop
up window.
open items_toKeepOpen_paths
set closure_limit to the (count (result as list))
tell (every window where (index of it > closure_limit) and (popup of
it is true))
set the popup to false
close
end tell
end tell

NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: 'Could not save changes...' error - addendum
  • Next by Date: Re: Can a link be extracted? (Automating Emailer)
  • Previous by thread: Re: closing all but very specific windows (NG delivers again)
  • Next by thread: Re: closing all but very specific windows
  • Index(es):
    • Date
    • Thread