To achieve something like the following:
tell application "Finder" to get every file of folder (choose folder) where name extension of every files of it is "pdf"
To achieve something like the following:
tell application "Finder" to get every file of folder (choose folder) where name extension of every files of it is "pdf"
Yes. It’s possible to filter for that, and you were pretty close.
tell application "Finder" to get every file of folder (choose folder) where its name extension = "pdf"
What about something like this
tell application "Address Book"
every person whose values of its one of its emails contains "@gmail.com"
end tell
In addition, how about this sort of filter reference:
tell application "Address Book"
every person where (count of its emails) is 2
end tell
email is an element of a Person, not a property, so you can’t do that – You’d find them this way:
set doubleEmails to {}
tell application "Address Book"
set V to value of email of every person
set N to name of every person
repeat with k from 1 to count N
if (count (item k of V)) is 2 then set end of D to item k of N
end repeat
end tell
So the whose/where clause can only evaluate properties of the object itself, but not properties of its elements, right?