Accessing Properties of a Script Object in a Whose Clause

Hello,

I am writing a script that reads a file and populates a list of People objects.


on construct_Person()
	script Person
		property last_name : ""
		property first_name : ""
		property home_phone : ""
	end script
	return Person
end construct_Person

property people : {}
-- ... read and populate list...

and then I tried to execute an ‘every in whose’ staement with no lock. I have tried a random assortment of keywords with no luck.


set r to every script in people whose home_phone contains "867"

How do you construct this statement to where it knows what home_phone is?

Cheers,
Jove

Welcome. :slight_smile:

Applications provide the support for the filter reference form; You can’t use that kind of reference with a regular list.

Hello,

If I understand it correctly then only a field-name in an application’s dictionary can go in the filter. So then I assume there is no way to use a script object’s properties in the clause. Or is there a way to do it?

I am planning on writing three versions of this script using Address Book, Database Events, and Script Objects. I would have liked to have used the filter clause in all three examples.

Cheers,
Dave