• 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: TechNote 2106
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TechNote 2106


  • Subject: Re: TechNote 2106
  • From: Chris Espinosa <email@hidden>
  • Date: Wed, 3 Mar 2004 13:27:35 -0800

On Mar 3, 2004, at 12:47 PM, Brennan wrote:

I was really curious to see this

feet are webbed of every duck
--> {true, true, missing value}

The elegance of this form impressed me, but I haven't yet found an app
that will even compile an expression like this.

Example:

tell application "Finder"
(name contains "test") of every file of desktop --> wont compile
end tell

Am I missing something?

This assumes that "feet are webbed" is a Boolean property of the class "duck". You probably read it as "feet" property being an enumeration with "webbed" as a possible value, and "are" as a valid comparison operator. Sadly, AppleScript doesn't support "are" as a comparison operator, nor can you embed a comparison in an object specifier like that, as you discovered in your Finder example.

The closest would be a whose clause:

tell application "Finder"
every file of desktop whose name contains "test"
end

which is roughly parallel to

every duck whose feet is webbed

Whose clauses, though, won't return 'missing value' in such a case, which is the point of that example.

Chris (The Other Chris)
_______________________________________________
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.


  • Follow-Ups:
    • Re: TechNote 2106
      • From: Walter Ian Kaye <email@hidden>
  • Prev by Date: RE: Print center delay
  • Next by Date: Re: getting 'continue' to return something (Was Re: Determining path to script)
  • Previous by thread: RE: Print center delay
  • Next by thread: Re: TechNote 2106
  • Index(es):
    • Date
    • Thread