• 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: Filters with "entire contents of"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filters with "entire contents of"


  • Subject: Re: Filters with "entire contents of"
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 17 Oct 2004 13:51:17 +0200

On 16/10/04 20:30, Michelle Steiner wrote:
Why don't the first three variations work?  (using Script Editor 2.0, AS 1.9.3, Panther 10.3.5)

-- Michelle

set f to choose folder
tell application "Finder"
   (entire contents of f) whose label index is not 0
end tell

-->  "Can't get entire contents of alias
\"Dora:Users:michelle:Desktop:speech class:\" whose label index  0.
Access not allowed."

Changing the line to
   get (entire contents of f) whose label index is not 0

--> "Can't get entire contents of alias
\"Dora:Users:michelle:Desktop:speech class:\" whose label index  0.
Access not allowed."

Changing it to
   (get entire contents of f) whose label index is not 0

--> "Can't get {list of entire contents of the folder}  whose label
index  0."

But changing it to the following yields the correct result:
(every item of entire contents of f) whose label index is not 0

You already got lots of replies.
So, if you allow, here follows an attempt to bring a sligthly different explaination...

I think the first three variations don't work because they just don't contain any valid filter reference forms.

Let's consider the first one; it may be viewed as:
    <property> of <object> whose <boolean>
In this case, the "<property> of <object>" part is "entire contents of f", which yields another object (that may be viewed as some kind of container - one that comes with every container); the end result is thus equivalent to asking for:
    <anobject> whose <boolean> [1]

Just try with:
set f to choose folder
tell application "Finder"
   f whose label index is not 0
end tell
-->  "Can't get alias
\"Dora:Users:michelle:Desktop:speech class:\" whose label index  0.
Access not allowed."
The error mesage has exactly the same structure, tending to show that the "entire contents of" part was not the faulty one.

On the other hand, your last variation (the working one) has following syntax:
    every item of <property> of <object> whose <boolean>
which reduces to:
    every item of <anobject> whose <boolean>
Clearly, one has a filter reference form here.

Hmm...
Have a nice sunday anyway ;-)
Axel

[1] Semantically equivalent I mean.
Should one split the evaluation of the whole _expression_, either by using an intermediate variable or with the "get" keyword (as in your third variation), one would just end with <anobject> being an AppleScript list.


 _______________________________________________
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: Filters with "entire contents of"
      • From: Michelle Steiner <email@hidden>
    • Re: Filters with "entire contents of"
      • From: Jan Cobb <email@hidden>
References: 
 >Filters with "entire contents of" (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Filters with "entire contents of"
  • Next by Date: Re: Filters with "entire contents of"
  • Previous by thread: Re: Filters with "entire contents of"
  • Next by thread: Re: Filters with "entire contents of"
  • Index(es):
    • Date
    • Thread