Re: Merging into Address Book

2004-04-21 Thread Chris Nandor
At 22:50 -0500 2004.04.20, Ken Williams wrote:
>On Apr 14, 2004, at 2:57 PM, Chris Nandor wrote:
>>
>> I've been called out!  ;-)  Here's a version with Mac::Glue.
>> ...
>
>Say, I built the Address_Book glue and looked through its docs, but I
>don't see methods to search the database for entries that have certain
>properties.  Do you know of any way to use the "Find" functionality, or
>specify required properties, using the applescript/glue interface?

Did you look at the Address Book example in ex/ ?  It uses whose() to find
entries.

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/


interesting article about security

2004-04-21 Thread Joseph Alotta


 * PC users 'fail security tests' *
Better security means not trusting users to do the right thing, argues 
an industry expert.
Full story:
http://news.bbc.co.uk/go/em/-/2/hi/technology/3625157.stm



Re: Merging into Address Book

2004-04-21 Thread Rick Frankel
On Tue, Apr 20, 2004 at 10:50:01PM -0500, Ken Williams wrote:

> Say, I built the Address_Book glue and looked through its docs, but I 
> don't see methods to search the database for entries that have certain 
> properties.  Do you know of any way to use the "Find" functionality, or 
> specify required properties, using the applescript/glue interface?

Here's the script I use for querying my addressbook from mutt.
The output format is specific to the mutt interface,
but the commented out section shows how to get the address info.

rick
 cut here ---
#!/usr/local/bin/perl
use Mac::Glue qw(:glue);
use Mac::Apps::Launch;

my $glue=Mac::Glue->new('Address Book',bundle=>'com.apple.AddressBook');
my $id=$glue->{ID};
if(!IsRunning($id)) {
LaunchApps($glue->{ID}) or die $^E;
$glue->close($glue->prop('window')) or warn $^E;
}

my $q=shift;
print "Querying AddressBook...\n";
my @people=$glue->obj('people')->get;
foreach my $entry (@people) {
my @emails=$entry->prop('email')->get;
next unless @emails;

foreach my $email (@emails) {
my $addr=$email->prop('value')->get;
my $name=$entry->prop('name')->get;
print "$addr\t$name\t",$email->prop('label')->get,"\n"
if $name =~ /$q/ || $addr =~ /$q/;
}
#my($addr)=$entry->prop('address')->get;
#next unless $addr;
#print $addr->prop('street')->get,"\n";
#print $addr->prop('city')->get," ";
#print $addr->prop('state')->get," ";
#print $addr->prop('zip')->get,"\n";
}
exit 0;