• 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: "where its" vs "whose"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "where its" vs "whose"


  • Subject: Re: "where its" vs "whose"
  • From: Jim Underwood <email@hidden>
  • Date: Mon, 29 Aug 2016 22:58:45 +0000
  • Thread-topic: "where its" vs "whose"

This is a very interesting, yet confusing subject.

I just reread this:

Reference Forms from the AppleScript Language Guide, which I found very helpful.  


Here is one section very relevant to our discussion here:



Filter

Specifies all objects in a container that match a condition, or test, specified by a Boolean _expression_.

The filter form specifies application objects only. It cannot be used to filter the AppleScript objects list, record, or text. A term that uses the filter form is also known as a whose clause.

Note: You can use the words where or that as synonyms for whose.

. . .

Within a test in a filter reference, the direct object is the object being tested. Though it isn’t generally needed, this implicit target can be specified explicitly using the keyword it, which is described in The it and me Keywords.

The following example shows several equivalent ways of constructing a filter reference to find all the files in a folder that whose name contains the word “AppleScript”. While the term it refers to the Finder application outside of the filter statements, within them of it refers to the current file being tested. The result of each filter test is the same and is not changed by including or omitting the term of it:

tell application "Finder"
    it --result: application "Finder" (target of tell statement)
    set myFolder to path to home folder
        --result: alias "Leopard:Users:myUser:"
    files in myFolder --result: a list of Finder document files
    files in myFolder where name of it contains "AppleScript"
    (* result: document file "AppleScriptLG.pdf" of folder "myUser"
        of folder "Users" of startup disk of application "Finder"}*)
    files in myFolder where name contains "AppleScript" -- same result
    every file in myFolder whose name contains "AppleScript" -- same result
    every file in myFolder where name of it contains "AppleScript"
        -- same result
end tell



Also, note that from The it and me Keywords. , "its" is a synonym for "of it".

The key point for our discussion is:
The result of each filter test is the same and is not changed by including or omitting the term of it:

So, doesn't that mean that "whose <property>" and "whose its <property>" and "whose <property> of it" are all equivalent?

Best Regards,

Jim Underwood
aka JMichaelTX


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: "where its" vs "whose"
      • From: Jim Underwood <email@hidden>
References: 
 >"where its" vs "whose" (From: Mitchell L Model <email@hidden>)
 >Re: "where its" vs "whose" (From: Axel Luttgens <email@hidden>)
 >Re: "where its" vs "whose" (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: Exiting an app with an infinite loop?
  • Next by Date: Re: "where its" vs "whose"
  • Previous by thread: Re: "where its" vs "whose"
  • Next by thread: Re: "where its" vs "whose"
  • Index(es):
    • Date
    • Thread