Palm wireless sync to AddressBook

user-pic
Vote 0 Votes

Address Book
Not that I'll ever get around to it, but I am so upset with the fact that my Palm Tungsten C cannot wirelessly sync with my Mac I was thinking about writing my own software to do it. A quick search on Google turned up the following bit of Perl (my language of choice) that would at very least let me access the AddressBook in OS X. I'll record it here for posterity as a step in the right direction.


#!/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 [at]people=$glue->obj('people')->get;
foreach my $entry (@people) {
    my [at]emails=$entry->prop('email')->get;

    next unless [at]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;

If anyone happens upon this page and already knows of software or code that allows for network sync with Macs, please leave a comment!

UPDATE: fixed my code listing using this script: SimpleCode

About this Entry

This page contains a single entry by Kevin published on May 15, 2004 9:04 PM.

Picture Perfect was the previous entry in this blog.

Starting classes tomorrow is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.