Re: Address Book
Re: Address Book
- Subject: Re: Address Book
- From: LE STANG Jean-Baptiste <email@hidden>
- Date: Fri, 10 Jan 2003 00:34:14 +0100
Ha, here is some code that might help you, I did not had time to make
it look better, nor opti=mize it, so it's a bit slow but it is working.
tell application "Address Book"
set allIdList to get id of every person
set groupIdList to {}
repeat with x in groups
set groupIdList to groupIdList & id of every person of x
end repeat
set FinalList to {}
repeat with x in allIdList
if x is not in groupIdList then set end of FinalList to (name of
people whose id is x) as string
end repeat
log FinalList --contains your list of users that doesnt belongs ot
groups
set recordCount to {}
repeat with x from 1 to count groupIdList
set myCount to 0
repeat with y from 1 to count groupIdList
if (x is not y) then
if item x of groupIdList = item y of groupIdList then set myCount
to myCount + 1
end if
end repeat
if myCount > 0 then set end of recordCount to {name:item x of
groupIdList, Gtimes:myCount}
end repeat
log recordCount -- a record with a) the id b) the number of times this
contact shows up
end tell
Jean-baptiste LE STANG
Le jeudi, 9 jan 2003, ` 18:23 Europe/Paris, Jan Erik Mostrvm a icrit :
I'm making my first stumbling attempts to script the address book and
already found a obstacles. I want to write a script a that selects all
addresses that doesn't belong to a group but I'm not able to figure
out:
+ How to use "whose" to find this out? (is it possible)
+ How to count the number of groups a person belongs to
(and this just the beginning 8-) Does anyone have some hints for me?
jem
--
Jan Erik Mostrvm email@hidden www.mostrom.pp.se
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.