Re: Address Book - Export Group
Re: Address Book - Export Group
- Subject: Re: Address Book - Export Group
- From: John M <email@hidden>
- Date: Wed, 5 Jan 2005 00:07:18 +0000
On 4 Jan 2005, at 13:35, email@hidden wrote:
Message: 2
Date: Mon, 3 Jan 2005 14:05:15 -0800
From: David Cox <email@hidden>
Subject: Address Book - Export Group
To: AS Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
Does anyone know how to export a group from address book as a "Group
vCard"? The interface in the application is easy enough, but I can not
find anything in the AS dict that does any sort of export action on
cards or groups.
Thanks,
DAC
I found this link <http://files.macscripter.net/scriptbuilders/Utilities/export_AddressBook_as_vcards.zip> to a script on macscripter.net by Sash Eranki and modified it slightly to give the script below. Obviously you'll need to set the folder path and group to suit.
By the way, on my system this works (I can re-import the vcard into the Addressbook), but the file is opened by TextEdit by default. How can you change this? I tried:
set default application of target_file to ((path to applications folder) as text) & "Address Book.app:"
but this doesn't seem to be allowed.
Best
John Maisey
---Export Group as vCards
--from script by Sash Eranki with modifications by John Maisey
tell application "Address Book"
set PathName to "Drive:Path:To:Folder:" -- insert your destination path here
set GroupName to "Group Name" -- insert your group name here
--
set npersons to count of people in group GroupName
set target_file to PathName & GroupName & ".vcf" as text
set vcardinfo to ""
repeat with i from 1 to npersons
set vcardinfo to vcardinfo & ¬
(vcard of person i of group GroupName) as text
end repeat
try
set the open_target_file to ¬
open for access file target_file with write permission
set eof of the open_target_file to 0
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 tell
---end Export Group as vCards
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden