In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Ken Williams) wrote:
> Hi Chris, > > This is all working great. I just realized, though, that my initial > email search isn't working - to find a person with the email $foo, I've > tried: > > $person = $glue->obj(people => whose(email => equals => $foo)); > > Obviously this can't work, because email is an element, not a property. > Is there a way to do this in a single query, or do I need to iterate > through some result list? I can't see a way. If someone can tell me how to do it in AppleScript, I can convert it to Mac::Glue. But I can't see how to do it in AppleScript either. push @found, $person if grep /aol/i, @emails; FWIW, here is what I would do to iterate: #!/usr/local/bin/perl use strict; use warnings; use Mac::Glue ':all'; my $glue = new Mac::Glue 'Address Book'; my @found; my @people = $glue->obj('people')->get; for my $person (@people) { my @emails = $person->prop(value => 'emails')->get; push @found, $person if grep /aol/i, @emails; } -- Chris Nandor [EMAIL PROTECTED] http://pudge.net/ Open Source Development Network [EMAIL PROTECTED] http://osdn.com/