Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does one save a vcard?



On 3/30/07 9:27 AM,
"applescript-users-bounces+berkowit=email@hidden"
<applescript-users-bounces+berkowit=email@hidden> wrote:

> 
> 
> tell application "Address Book"
>     set daName to name of person 1
>     set vcardData to vcard of person 1
> end tell
> 
> set dest to (path to home folder as Unicode text) & daName & ".vcf"
> set foo to open for access file dest with write permission
> set eof foo to 0
> write vcardData to num
> close access foo


Sorry, Michele, I changed the variable name inconsistently after testing
(there's a 'num' in the penultimate line that should be a 'foo'). Should be:



tell application "Address Book"
    set daName to name of person 1
    set vcardData to vcard of person 1
end tell

set dest to (path to home folder as Unicode text) & daName & ".vcf"
set foo to open for access file dest with write permission
set eof foo to 0
write vcardData to foo
close access foo

tell application "Finder"
    set file type of file dest to missing value
    set creator type of file dest to missing value
end tell


-- 
Paul Berkowitz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: How does one save a vcard? (From: Paul Berkowitz <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.