Getting every person in an address book group

I am doing the following:


set grp to item 1 (choose from list (get the name of every group) with prompt "Select Group:")

repeat with p in (every person in grp whose note is not missing value)

...

end repeat


I get an error that says:


Can't get every person of \"Test Group\"." number -1728 from every <<class azf4>> of "Test Group".

This seems to work ok in a unit test when I create a new apple script but doesn’t work at all in my overall script.

Should I be coercing my return value to a text item? What am I doing worng?

Hi,

you’re trying to get every person of a literal string, which of course cannot work


.
repeat with p in (every person in group grp whose note is not missing value)
.

This seems to solve the problem


repeat with p in (every person in item 1 of group grp whose note is not missing value)