• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
some address book scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

some address book scripts


  • Subject: some address book scripts
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 6 Apr 2007 16:38:17 -0700

Here are the final versions of the scripts I was writing for the Address Book:

To create a VCF file of all contacts:

set daName to "vcards.vcf"
tell application "Address Book" to set vcardData to vcard of the people
tell application "Finder"
make new file with properties {name:daName} at (choose folder)
set destination to the result as alias
end tell
set fileRef to open for access destination with write permission
set eof fileRef to 0
write (vcardData as text) to fileRef
close access fileRef


To add people to groups:

tell application "Address Book"
set the peeps to (choose from list (get the name of the people) with multiple selections allowed)
set the grps to (choose from list (get the name of the groups) with multiple selections allowed)
repeat with this_peep in the peeps
repeat with this_group in the grps
add person this_peep to group this_group
end repeat
end repeat
save addressbook
end tell

Is there any way to eliminate either or both of the loops in the second script?

-- Michelle

-- 
America: A nation of people avoiding moderation like it's the plague.


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

This email sent to email@hidden

  • Prev by Date: Small real not working
  • Next by Date: Re: rtf and rtfd (Related to Getting at Some Hidden Clipboard Contents)
  • Previous by thread: quark Spread Saving Question
  • Next by thread: Re: rtf and rtfd (Related to Getting at Some Hidden Clipboard Contents)
  • Index(es):
    • Date
    • Thread