Access to the Mac OS X Address Book

Yves COPPE yvescoppe at skynet.be
Mon Feb 21 07:38:26 EST 2005


Le 21-févr.-05, à 13:07, Joel Guillod a écrit :

> Is there a way to access to the Mac OS X Address Book from Revolution?
> I found that RealBasic provides classes to do this so you can read 
> from or write to the
> Address Book.
>
>


try with applescript :


tell application "Finder" to make file at desktop with properties 
{name:"adresses.txt"}
set exportFile to (((path to desktop) as string) & "adresses.txt") as 
alias

tell application "Address Book"
	set addressBookAsList to every person
	open for access exportFile with write permission
	repeat with i from 1 to count of addressBookAsList
		set theName to (name of item i of addressBookAsList)
		set theBirthDate to (birth date of item i of addressBookAsList) as 
string
		set eAddress to {value of first email of item i of addressBookAsList}
		write (theName & tab & theBirthDate & tab & eAddress & return) as 
string starting at eof to exportFile
	end repeat
	close access exportFile
	quit application "Address Book"
end tell


Greetings.

Yves COPPE
yvescoppe at skynet.be


More information about the use-livecode mailing list