-- send Address Book to web server -- Assumes an RSA key pair is already established set PathName to "Drive:WorkingFolder:" -- insert your folder path here tell application "Finder" set theFile to PathName & "AddressBook.vcf" try delete theFile -- Delete previous export, if present end try end tell tell application "Address Book" -- Do new export set npersons to count of people repeat with i from 1 to npersons set vcardinfo to (vcard of person i) as text set personName to (name of person i) as text set target_file to PathName & "AddressBook.vcf" as text try set the open_target_file to open for access file target_file with write permission write vcardinfo to the open_target_file starting at eof close access the open_target_file on error theErrMsg number theErrNumber return theErrNumber end try end repeat end tell tell application "Terminal" -- upload file activate do script "scp /Volumes/Drive/WorkingFolder/AddressBook.vcf user@yourwebsite.com:/pathToVCardPHP/AddressBook.vcf" in window 1 -- send file to remote server do script "exit" in window 1 delay 90 -- increase to allow time to upload if needed quit end tell