• 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: Another Tiger mystery...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another Tiger mystery...


  • Subject: Re: Another Tiger mystery...
  • From: Paul Berkowitz <email@hidden>
  • Date: Wed, 27 Jul 2005 13:37:09 -0700
  • Thread-topic: Another Tiger mystery...

Title: Re: Another Tiger mystery...
On 7/27/05 1:20 PM, "David Crowe" <email@hidden> wrote:

The following script works (it closes all Finder windows except the frontmost):

tell application "Finder"
       set Window1Name to name of window 1
     set theList to every window whose name ≠ Window1Name
   close theList
end tell


Yet, the following code, which used to work in 10.3, no longer works:

tell application "Finder"
       set Window1Name to name of window 1
     close (every window whose name ≠ Window1Name)
end tell


The error is: "Finder got an error: Handler can't handle objects of this class."

Can anyone explain?


Do this:

        
tell application "Finder"
      set Window1Name to name of window 1
     close (get every window whose name ≠ Window1Name)
end tell

(Use explicit 'get').

The current AppleScript implementers of Apple applications seem unaware of the philosophy behind AppleScript (that they need to strive for easy-to-read "Englishness") and don't know enough to check for this aspect. It's something that doesn't come "automatically" but has to be consciously implemented. Probably some small change was made to the code for Finder windows (or perhaps 'close') and when the AppleScripting was rough-tuned it simply didn't occur to anyone to check for whatever it is that lets you perform a command on the result of a 'whose' filter without insisting on resolving the result by an explicit 'get' or a separate line setting a variable to it.

--
Paul Berkowitz
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Another Tiger mystery...
      • From: Barry Wainwright <email@hidden>
References: 
 >Another Tiger mystery... (From: David Crowe <email@hidden>)

  • Prev by Date: Another Tiger mystery...
  • Next by Date: Re: set myList to myList & ...(Digest, Vol 2, Issue 493)
  • Previous by thread: Another Tiger mystery...
  • Next by thread: Re: Another Tiger mystery...
  • Index(es):
    • Date
    • Thread