Sorting names from address book
How do I do a secondary sort by first name after I have sorted by last name so that my people are listed alphabetically by first name if they have the same last name?
Thank for the feedback.
In the future, don't forget that the Help and the PDF User Guide are our friends.
Searching for 'sort' returns a link to the page 'Sorting table cells'
which states:
To sort all the cells in a column and then re-sort the results using another column’s values, open the Sort & Filter panel, choose a column and sort order in the Sort pop-up menus, _click +, choose another column and sort order,_ and then click Refresh.
Yvan KOENIG (from FRANCE dimanche 7 décembre 2008 12:46:46)
Similar Messages
-
Printing "child" names from Address Book on address labels
When I put selected "child" names on Address Books entries and try to print address labels including the kid's names, they don't appear. Example: I add "Jim" as a child name to an Address Book entry for Mike Jones. I try to print the Address Label: Mike Jones and Jim. Jim will not print. "JI" will print. "Jimm" will print. Anybody else have this problem? What's going on?
From another thread:
If you have a spouse or child listed on contact card it will print them all on the mailing label IF the first name of each person is unique to your entire address book. For example, if the contact is John Brown and the spouse is listed as Susan Brown and the child is listed as Chester Brown, the expectation is that the label would print as:
John, Susan and Chester Brown
This assumes that there are no other contacts in your address book with the first name of Susan or Chester. However, if, for example, you have another person in your contact list named Susan (the last name could be anything), Address Book will print:
John and Chester Brown
This is because Address Book looks at all the first names in your contact list and if it sees a first name that is also listed in one of the spouse or child fields then it looks to see if the the other contact shares the same address as the contact you are trying to print. If the address is the same, then it prints properly on the label. If not, then it doesn't print on the label. So if you have two Susans - Susan Anderson and Susan Brown - Address book looks at the address on each card and determines that Susan Brown has the same address as the contact you are trying to print (John Brown) and therefore prints her name on the label.
So, to make a long story short, if you want consistent and predictable results when printing your labels you should assign a unique card to each person that you want to appear on the label and make sure that the individual cards have the same address listed on each. So, in the above example, there would be a card for John Brown, a card for Susan Brown, and a card for Chester Brown. On John Brown's card, Susan Brown would be listed as spouse and Chester Brown would be listed as child. Print John Brown's card and you should get:
John, Susan and Chester Brown
Although this makes logical sense, it's not incredibly intuitive and not very well documented by Apple. I was hoping they would enhance Address Book in Leopard since this seems like a feature that a lot of people would use around this time of year. Unfortunately, that wasn't the case this time around. -
ICal incorrectly takes name from Address Book to show in birthday calendar
When I-Cal takes the name of a birthday person from Address Book to post a reminder on the birthday calendar of I-Cal it shows the first name as though it was the last name. I have verified this problem by reversing the names in Address Book, whereupon I-Cal shows the name correctly in the birthday calendar.
Obviously the program is defective and needs to be corrected.You probably have not clicked the "show birthday calander" in the ical preferences pane
-
Preference for not using middle names from address book in emails
I have quite a few contacts that I have their middle names in my address book. When I type their name in a new email, their full name is displayed in the "To" field. I don't want the middle name to show up in my outgoing emails. I also don't want to delete everyones middle name from my address book. Are there any preferences or plugins that allow this behavior?
I also have some contacts that I have nicknames for...the most glaringly obvious being "Mom" and "Dad." I don't want to send an email to my parents with their name in the "To" field. Is there a plugin or a preference for this as wellGreetings,
Sorry, but there's no way to do what you want. The only way to avoid using a middle name in the To: field is for you to delete that from your contact, and from the Previous Recipients list in Mail. The same would be true for those contacts where you have a nickname.
But ultimately, the name use by Mail and Address Book would be determined by the recipient when they send you an email; if they use their full name, that's what Address Book will change it to. -
Delete large number of names from address book
By mistake I imported a large database of names and addresses into Address book a while ago.
I now find the Address book is too bulky and wish to remove 80% of the names.
How can I do this easily? Or is is simple to start a new address book from scratch?
ThanksThanks, rkaufmann87, I've tried that many times thinking I can sneak up on it (funny when we're to the point to try ANYTHING)----AB not cooperating on that one, either. The group will delete, but the names/cards are still on the main list and won't delete from the main Address Book. If you "select all" it goes back to the Address Book main list, not the group which is wanting to be deleted.
-
Mail fails to recognize names from address book
My information in address book shows as follows
Name: J Doe
Email address: [email protected]
If someone has me in their address book as Doe John and sends an email to me at my email address ([email protected]), Mail.app does not recognize me and asks me if I want to 'Add to Address Book'.
The same happens if a sender has a minor change in the Name (such as even a dot in the name) of any recipient, regardless of the fact that I have the correct name in the address book. Mail fails to recognize the recipient even though the email address is identical, and will ask me if I want to 'Add to Address Book'.
One would expect Mail to use just the email address and recognize the contact as already being in the Address Book.
I just spent a good three hours investigating this.
There have been numerous posts discussing this both here and elsewhere over the years but I'm surprised that there has not been a solution. Here are some examples..
1. Mail can't recognize my contact email address
2. Address Book editing
3. Mail doesn't show names from the Address Book
In the 3rd example above, Golden Shoes suggests that this is the same for every email client, but I must disagree because Postbox and Thunderbird does display the information correctly from the Address Book, infact Postbox does this impressively I must add.
It would be great if this was fixable in Mail. Is there a solution for this?I followed your suggestions.
Both AB and AB within Mail were empty of contacts after I deleted my iCloud contacts from the mac. I even did a reboot just in case. After this, I rechecked contacts and all my contacts appeared again both in AB and AB within Mail.
I quit and reopened Mail to find that the problem still persisted. I know and rechecked that these contacts are not present in my previous recipients list so it is definitely not that database which is preventing this.
The funny thing (maybe not funny since this is really bugging me) is that Mail on iOS (iPhone) works just fine. The Mail on iPhone seems to query the sender/recipient email address, accurately realizes that the contact is already in the AB, and shows as such. The same email in Mail.app on the mac asks me if I want to add the contact to AB.
Is this really a unique situation? Is everyone else not experiencing the same?
If you ask someone to change your name within their address book and send an email to you, does Mail on the mac recognize you regardless of what that sender named you as? Or does it ask you to add to AB? -
TB on new Windows 8.1 computer won't lookup names from address book
The computer came with Windows 8 and TB worked fine. After upgrading to Windows 8.1 Update, I had to reload the address book from an old Outlook Express system under Windows XP. Now the address lookup isn't happening when I create a new email.
I should add that I am trying to get the autofill function working but all that happens is that characters appear in red as I type in the email address until the complete address is typed.
-
How do I force Mail to use contact names in Address Book?
I ~need~ Apple Mail to display sender names as I have them in Address Book. My students are Thai and have typed their sender names in Thai, so I can't recognise a thing. I've sorted all the names out in Address Book (in English) but Mail still displays sender names using the email default, rather than the names from Address Book.
• Upon receiving new mail however, the message's sender name ~WILL~ show up as the name put in Address Book. HOWEVER, after viewing the message the name reverts back to the one specified by the email author!! After that I can't get the name to show up as the Address Book name!
Is there a toggle somewhere? How do I force Mail to use the contact names from Address Book?Try unchecking this:
-
How can i get my names in address book to forward emails. i used to drag
i down loaded maverick i can no longer drag names from address book to forward gmail. what do i do?
Hi ArtWench,
If you are having issues getting your contacts into iCloud, you may find the following article helpful:
iCloud: Troubleshooting iCloud Contacts
http://support.apple.com/kb/TS3998
Regards,
- Brenden -
Mail and addresses from Address Book
When I type an e-mail address in the "To" field of a new message, Mail recovers the full name from Address Book and adds it to the e-mail address. Sometimes I don't want this to happen, instead I want to enter just the plain e-mail address. I know I can edit the address in the "To" field, but I have to enter some character(s) to override the default, otherwise if I just remove the name the system puts back the full name from Address Book. Is there a possibility to get just the e-mail address from Address Book but not the full name of that person? Sometimes I use nicknames, or mnemonic characters instead of real names and I don't want these to be seen by the recipient.
I like the idea of Mail retrieving the email addresses from Address Book, but what I don't like is that it also retrieves "Last" and"First" names, and that it does not allow me to remove them from the "To" field when composing the message. Imagine that I have an entry in my Address Book such as "JOHN (THE FAT) DOE", Or "MARY (THE BLOND) DOE". Obviously, I do not want the recipients to know that I call them "the fat John", or "the blond Mary". Or, that I am sending a message to several people, and for confidentiality reasons I do not want them to know the names of the others. In other words, I want to retrieve email addresses from Address Book but NOT the real name of that person, or at least have the possibility to remove Last and First Names from the "To" field and show only the email address.
Thanks, and regards. -
Add Attendees (name AND phone no.) from Address Book to iCal for iPhone use
Hello scripting gurus and newbs alike.
I've looked through the forums, but can't find a COMPLETE solution to what I believe should be a fairly straightforward problem. I'll start by asking the question as concisely as I can, then bring in more information about what I have tried, and learned, so far. I'll also outline my broad (mini) project aims at the end, in case anyone is interested.
* Q: How can I add attendees, from my Address Book, to an iCal event, so that **ALL** the attendee details are included?
Note: It is VITAL to me that attendees' phone number(s) are available through iCal, not just {display name, email, participation status}. This is because I want MobileMe to synch the event with my iPhone, so I can call attendees directly from iCal. (or at least have iCal open the attendee's Contacts record so I can call from there!)
WHY DO I THINK IT SHOULD BE POSSIBLE?
Manually, I can simply dbl-click on the event, click into the attendees field, start typing the attendee name, and hit enter. When I do this, it works. MobileMe synchs it to the iPhone, I open iCal, select the event, tap the attendee, and I'm calling.
WHAT I'VE TRIED USING APPLESCRIPT
When I try the following script, I've only managed to set Sheila's name/email/participation status. I can retrieve her phone number from Address Book using the above approach, but unsure how to make it stick in iCal * such that I am able to use it to call directly from iCal on the iPhone *
++++++++++++++++++++++
tell application "Address Book"
set anAttendee to name of (first person whose name contains "Sheila")
end tell
tell application "iCal"
set newEvent to make new event at end with properties ¬
{summary:"Meeting Info.", location:"ZIP", description:"More yak", start date:SD, end date:SD + 120 * minutes}
make new attendee at end of attendees of newEvent with properties {display name:anAttendee}
end tell
++++++++++++++++++++++
WHERE I'VE LOOKED FOR SIMILAR EXAMPLES
Thanks to Rob (et al) for providing script examples used to create the above, see here: http://macscripter.net/viewtopic.php?id=5692
I've also looked at the following article, which makes me think I somehow need to use the PERSON ID in the event attendee list. Unfortunately, I have only managed to retrieve the ID, but had no joy trying to set it.
http://www.mactech.com/articles/mactech … index.html
THE PROJECT
I'm a surveyor, and using dialog(s) to enter relevant info., I'm looking to streamline my preparation for surveys when I make each new appointment.
My mini-project presently enables me to print survey forms (based on a Pages template) with details relating to the specific property (address/contact name&no./appointment date&time etc.) It also uses the appointment date&time to create the appropriate event in iCal.
I'm also confident I can add the contact details, such as agent/owner name(s) and phone number(s) in Address Book.
IF I COULD ONLY ADD THESE AS ATTENDEE(S), AS IF ADDED MANUALLY, I WOULD ALSO BE ABLE TO PHONE THE PROPERTY OWNERS WITH A COURTEOUS REMINDER WHEN I'M ON THE WAY!!
Can anyone help me achieve this?
Here's hoping.
Phil (wiimixer)Phil
Referencing the attendee in iCal will only directly record the properties you mention - because that's how it's designed to work and there's no way around the restriction unless iCal is changed.
You could set the phone number elsewhere in the iCal event - e.g. notes, location, ... - and that would probably allow you to call from iCal (I don't have an iPhone so I can't be sure), but I am not sure I see the advantage over using the link to iPhone's Address Book which is set up by adding an attendee to the event. This might be because I am being dense, so if this is the case please elaborate.
EDIT:
I have read your original post in more detail since I wrote the above. It seems to me that you are saying that when you add the person to the iCal event via AppleScript that you do not get the link to the iPhone's Address Book when you sync via MobileMe. You imply, however, that it does work when you type the name manually. Are these both correct statements?
Message was edited by: Bernard Harte -
Pages-when using template for envelopes can you import names/address from address book
When using templates for envelopes can you import names/address from the address book?
Drag the VCard from Address Book onto the open envelope template.
If you want mutiple addresses make a Group of those in Address Book and drag the Group icon onto the Pages template.
Peter -
Apple Script to Sort through the Address Book
Dear All,
I am quite new to Apple and just a learner on Apple-scripts. Its been quite a task to learn.. I would require some help on a few things..
The script will eventually use numbers to send email and get the user inputs and any yet to reach there..
After going through lots of scripts to sort through the address book and make a clean address book, i found they are quite slow in processing takes about 20~30 Minutes to get through 2000 Contacts..
Hence after reading posting of Mr. Koenig & Mr. Hiroto and specifically on deep copy. I have written the following code which does the following on 2000 records within 6~8Mins.
The Script work its way through all the contact is the address List.. and creates Groups
1. Duplicate Email Id's — List of Contacts with same email ID's including Contacts where the email Id is entered twice.. (Strange.. Address Book Issue, copy of the email Id under work & home)
2. Duplicate Phone — List of Contacts with same Phone Numbers including Contacts where the Phone Nos is entered twice.
3. Duplicate Name — List of Contacts with Same Names
4. Duplicate No Name — List of Contacts without the First Name and Last Name
it also sort the Contacts under the following Group which you can edit later with all the information's..
1. Only Email Ids — List of Contacts with Email ID and No Phone Numbers
2. Only Phone — List of Contacts with Phone Numbers and No Email Id's
3. No Email or Phone — List of Contacts with No Email Id's and No Phone numbers (some half completed contacts )
My Question to the forum is why is the following code still taking too much time..
set onlyDupEList to every person of group theGroupEmail
repeat with j from 1 to count of Dup_email
set tempdata to item j of Dup_email
if onlyDupEList does not contain {tempdata} then add tempdata to group theGroupEmail
end repeat
save application "Address Book"
and the scripts slows down when the items in the list is quite large (over 800 or so )..
Any help is appreciated and thanks in advance..
-- the code ---
global MsgTitle
on run
set MsgTitle to "Search for Duplicates in Address Book Contacts"
display dialog ¬
"This Script takes a while to finish" & return & "maybe 10 min or More..." & return & "Depending on the Address Book Contacts." & return & return & "Hence Allow it to run for the while" with title MsgTitle ¬
with icon 1 ¬
buttons {"Continue"} ¬
giving up after 5
set question to display dialog "Select the Duplicate Search Parameter " with icon 1 with title MsgTitle ¬
buttons {"Contact Name", "Contacts on Phone & Email Id's", "Quit"} default button 3
set rtnValue to button returned of question
if rtnValue is "Quit" then
-- tell application "Address Book" to quit
tell me to quit
end if
if rtnValue is "Contact Name" then
-- tell application "Address Book" to quit
GetDup_byName("Duplicate Name")
end if
if rtnValue is "Contacts on Phone & Email Id's" then --Contacts on Phone & Email Id's
-- tell application "Address Book" to quit
Get_dup()
end if
end run
--- Search on Name Field ---
on GetDup_byName(theGroupName)
set question to display dialog "Do you want to search for duplicates based on Names? " with icon 0 with title MsgTitle ¬
buttons {"Continue", "Quit"} default button 1
set rtnValue to button returned of question
if rtnValue is "Quit" then
-- tell application "Address Book" to quit
tell me to quit
end if
tell application "Address Book"
activate
set biglist to {}
set NoNameList to {}
set theGroupNoName to "Duplicates No Names"
set theGroup to theGroupName
-- if not (exists (group "Dupilicate Entries")) then
if not (exists (group theGroup)) then
make new group with properties {name:theGroup}
save
end if
if not (exists (group theGroupNoName)) then
make new group with properties {name:theGroupNoName}
save
end if
set the_names to name of people
repeat with i from 1 to number of items in the_names
set theName to item i of the_names
-- return theName
if theName is not in biglist then
copy theName to end of biglist
else
set counter to (people whose name is theName)
if (count of counter) > 1 then
repeat with i from 1 to number of items in counter
set this_item to item i of counter
-- display dialog this_item
add this_item to group theGroup
end repeat
-- return counter as string
end if
end if
-- captures the Contacts without Name ---
if theName contains "@" then
-- display dialog theName
set counterList to (people whose name is theName)
repeat with i from 1 to number of items in counterList
set this_item to item i of counterList
-- display dialog this_item
add this_item to group theGroupNoName
end repeat
end if
-- save application "Address Book"
end repeat
save application "Address Book"
set peopleCount to (count every person)
-- set peopleCount to 50 -- only for testing --
repeat with i from 1 to peopleCount
set first_name to first name of person i as string
set Last_Name to last name of person i as string
if first_name is equal to "missing value" and Last_Name is equal to "missing value" then
-- display dialog first_name & " : " & Last_Name
set end of NoNameList to (id of person i)
end if
end repeat
repeat with j from 1 to the count of NoNameList
set tempdata to item j of NoNameList
-- set testdata to person id tempdata
-- if (name of groups of testdata does not contain theGroupNoEmail) then
add tempdata to group theGroupNoName
-- end if
end repeat
save application "Address Book"*)
display dialog ¬
"This Script Finished Processing Address Book Contacts the Duplicates are in the group" with title MsgTitle ¬
with icon 1 ¬
buttons {"Continue"} ¬
giving up after 5
end tell
end GetDup_byName
on Get_dup()
set question to display dialog "Do you want to search for duplicates based on Names? " with icon 0 with title MsgTitle ¬
buttons {"Continue", "Quit"} default button 1
set rtnValue to button returned of question
if rtnValue is "Quit" then
-- tell application "Address Book" to quit
tell me to quit
end if
tell application "Address Book"
activate
set theGroupEmail to "Duplicate Email Id's"
set theGroupPhone to "Duplicate Phone"
set theGroupNoEmail to "Only Phone Numbers"
set thegroupNoPhone to "Only Email Id's"
set theGroupNoData to "No Email or Phone"
-- set theGroup to theGroupName
if not (exists (group theGroupEmail)) then
make new group with properties {name:theGroupEmail}
save "Address Book"
end if
if not (exists (group theGroupPhone)) then
make new group with properties {name:theGroupPhone}
save "Address Book"
end if
if not (exists (group theGroupNoEmail)) then
make new group with properties {name:theGroupNoEmail}
save "Address Book"
end if
if not (exists (group thegroupNoPhone)) then
make new group with properties {name:thegroupNoPhone}
save "Address Book"
end if
if not (exists (group theGroupNoData)) then
make new group with properties {name:theGroupNoData}
save "Address Book"
end if
set ListofPeople to people --the_ID
set ListofEmailID to value of emails of people --the_emails
-- return ListofEmailID
set ListofPhones to value of phone of people -- the_phones
-- return ListofPhones
set biglist to {}
set ListEmail_Uniq to {}
set ListEmail_Dup to {}
set No_PhoneList to {}
set No_EmailList to {}
set No_dataList to {}
set FlagEmail to false
set FlagPhone to false
-- repeat with i from 1 to number of items in the_emails
repeat with i from 1 to count of ListofEmailID
set thePersonID to item i of ListofPeople
set theEmails to item i of ListofEmailID
if theEmails is equal to {} then
set end of No_EmailList to thePersonID
else
-- set FlagEmail to true
repeat with j from 1 to count of theEmails
set tmpdata to item j of theEmails
-- return tmpdata
if tmpdata is not in biglist then
set end of biglist to tmpdata
set end of ListEmail_Uniq to {tmpdata} & {thePersonID}
else
set end of ListEmail_Dup to {tmpdata} & {thePersonID}
end if
end repeat
end if
end repeat
-- return ListEmail_Uniq
-- return ListEmail_Dup
-- save application "Address Book"
set biglist to {}
set ListPhone_Uniq to {}
set ListPhone_Dup to {}
-- repeat with i from 1 to number of items in the_emails
repeat with i from 1 to count of ListofPhones
set thePersonID to item i of ListofPeople
set thePhones to item i of ListofPhones
if thePhones is equal to {} then
set end of No_PhoneList to thePersonID
else
-- set FlagPhone to true
repeat with j from 1 to count of thePhones
set tmpdata to item j of thePhones
-- return tmpdata
if tmpdata is not in biglist then
set end of biglist to tmpdata
set end of ListPhone_Uniq to {tmpdata} & {thePersonID}
else
set end of ListPhone_Dup to {tmpdata} & {thePersonID}
end if
end repeat
end if
end repeat
-- return ListPhone_Uniq
-- return ListPhone_Dup
set the Dup_email to {}
-- Find the Duplicates from the sorted list --
repeat with i from 1 to the count of ListEmail_Dup
set tempdata to item i of ListEmail_Dup
set dataEmailDup to item 1 of tempdata
set dataPersonDup to item 2 of tempdata
repeat with j from 1 to the count of ListEmail_Uniq
set tempdata to item j of ListEmail_Uniq
set dataEmailUniq to item 1 of tempdata
set dataPersonUniq to item 2 of tempdata
-- display dialog mainEmail1 & "=" & mainEmail2 & " " & mainID1 & "=" & mainID2
if dataEmailDup is equal to dataEmailUniq then
set end of Dup_email to dataPersonDup -- & "," & dataPersonUniq
set end of Dup_email to dataPersonUniq
end if
(* -- the code takes lot more time if add to group was used --
if dataEmailDup is equal to dataEmailUniq then
set testdata to person id dataPersonDup
add testdata to group theGroup
set testdata to person id dataPersonUniq
add testdata to group theGroup
end if
end repeat
end repeat
-- return Dup_email
set the Dup_Phone to {}
-- Find the Duplicates from the sorted list --
repeat with i from 1 to the count of ListPhone_Dup
set tempdata to item i of ListPhone_Dup
set dataPhoneDup to item 1 of tempdata
set dataPersonDup to item 2 of tempdata
repeat with j from 1 to the count of ListPhone_Uniq
set tempdata to item j of ListPhone_Uniq
set dataPhoneUniq to item 1 of tempdata
set dataPersonUniq to item 2 of tempdata
-- display dialog mainEmail1 & "=" & mainEmail2 & " " & mainID1 & "=" & mainID2
if dataPhoneDup is equal to dataPhoneUniq then
set end of Dup_Phone to dataPersonDup -- & "," & dataPersonUniq
set end of Dup_Phone to dataPersonUniq
end if
(*if dataPhoneDup is equal to dataPhoneUniq then
set testdata to person id dataPersonDup
add testdata to group theGroup
set testdata to person id dataPersonUniq
add testdata to group theGroup
-- save
end if*)
end repeat
end repeat
-- return Dup_Phone
set onlyDupEList to every person of group theGroupEmail
repeat with j from 1 to count of Dup_email
set tempdata to item j of Dup_email
if onlyDupEList does not contain {tempdata} then add tempdata to group theGroupEmail
end repeat
save application "Address Book"
set onlyDupPList to every person of group theGroupPhone
repeat with j from 1 to count of Dup_Phone
set tempdata to item j of Dup_Phone
if onlyDupPList does not contain {tempdata} then add tempdata to group theGroupPhone
end repeat
save application "Address Book"
set onlyPhoneList to every person of group theGroupNoEmail
repeat with j from 1 to the count of No_EmailList
set tempdata1 to item j of No_EmailList
if No_PhoneList does not contain {tempdata1} then
if onlyPhoneList does not contain {tempdata1} then add tempdata1 to group theGroupNoEmail
end if
(*set flagE to false
repeat with i from 1 to the count of No_PhoneList
set tempdata2 to item i of No_PhoneList
if tempdata1 is equal to tempdata2 then
set flagE to true
exit repeat
end if
end repeat
if flagE is false then add tempdata1 to group theGroupNoEmail*)
end repeat
save application "Address Book"
set onlyEmailList to every person of group thegroupNoPhone
repeat with j from 1 to the count of No_PhoneList
set tempdata1 to item j of No_PhoneList
if No_EmailList does not contain {tempdata1} then
if onlyEmailList does not contain {tempdata1} then add tempdata1 to group thegroupNoPhone
end if
end repeat
save application "Address Book"
set onlyList to every person of group theGroupNoData
repeat with i from 1 to count of ListofPeople
if (item i of ListofEmailID is equal to {}) and (item i of ListofPhones is equal to {}) then
set tempdata to item i of ListofPeople
if onlyList does not contain {tempdata} then add tempdata to group theGroupNoData
end if
end repeat
save application "Address Book"
display dialog ¬
"This Script Finished Processing Address Book Contacts the Duplicates are in the group" with title MsgTitle ¬
with icon 1 ¬
buttons {"Continue"} ¬
giving up after 5
end tell
end Get_dup
on quit
--set MsgTitle to "Change Email ID's Domain Name"
save application "Address Book"
display dialog "Contact Srikanth Kamath at [email protected] for any Help" with title MsgTitle with icon 1 buttons "OK"
continue quit
end quitHello Srikanth Kamath,
I'm not sure you're still following this thread, but anyway here's sample code I said I'd post later.
--SCRIPT2
main()
on main()
script o
-- input data
property xx : {1, 2, 3, 4, 5} -- list of parents
property yy : {{"g", "h"}, {"a", "b"}, {"b", "e", "f"}, {"e"}, {"c", "d"}} -- list of children per parent
-- work list
property pp : {} -- list of children tagged by parent; i.e, lits of {child, parent}
property qq : {}
property rr : {}
-- (1) build list of children tagged by parent
repeat with i from 1 to count my xx
set x to my xx's item i
set y to my yy's item i
repeat with p in y
set end of my pp to {p's contents, x}
end repeat
end repeat
--return pp -- {{"g", 1}, {"h", 1}, {"a", 2}, {"b", 2}, {"b", 3}, {"e", 3}, {"f", 3}, {"e", 4}, {"c", 5}, {"d", 5}}
-- (2) sort tagged list by child as key
msort(my by_key1, my pp)
--return pp -- {{"a", 2}, {"b", 2}, {"b", 3}, {"c", 5}, {"d", 5}, {"e", 3}, {"e", 4}, {"f", 3}, {"g", 1}, {"h", 1}}
-- (3) retrieve parents with duplicate child
(* retrieve list of {child, parent} for duplicate child *)
set my qq to uniq(my eq_key1, my pp, {_dup:true})
--return qq -- {{"b", 2}, {"b", 3}, {"e", 3}, {"e", 4}}
(* retrieve list of parent *)
repeat with q in my qq
set r to q's item 2
if r is not in my rr then set end of my rr to r
end repeat
return rr -- {2, 3, 4}
end script
tell o to run
end main
on by_key1(x, y)
msort's comparator for list of lists
key = item 1, ascending
returns true iff x and y are out of order
return x's item 1 > y's item 1
end by_key1
on eq_key1(x, y)
uniq's comparator for list of lists
key = item 1
returns true iff x and y are considered equal
return x's item 1 = y's item 1
end eq_key1
on msort(cmp_, aa) -- v1.2f2
Basic recursive merge sort handler having list sorted in place.
handler cmp_ : comparator
* cmp_(x, y) must return true iff list element x and y are out of order.
list aa : list to be sorted in place
script o
property parent : {} -- limit closure to minimum
property xx : aa -- to be sorted in place
property xxl : count my xx
property yy : {}
property cmp : cmp_
on merge(p, q, r)
property xx: source list
integer p, q, r : absolute indices to specify range to be merged such that
xx's items p thru r is the target range,
xx's items p thru (q-1) is the first sublist,
xx's items q thru r is the second sublist.
(p < q <= r)
local i, j, k, xp, xr, yi, yj, ix, jx
if r - p = 1 then
set xp to my xx's item p
set xr to my xx's item r
if my cmp(xp, xr) then
set my xx's item p to xr
set my xx's item r to xp
end if
return -- exit
else
if p < q - 1 then merge(p, (p + q) div 2, q - 1)
merge(q, (q + r + 1) div 2, r)
end if
At this point, sublits xx[p, q-1] and xx[q, r] have been already sorted (p < q <= r)
if my cmp(my xx's item (q - 1), my xx's item q) then
else -- xx[p, q-1] & xx[q, r] are already sorted
return
end if
set yy to my xx's items p thru r -- working copy for comparison
set ix to q - p
set jx to r - p + 1
set i to 1
set j to q - p + 1
set k to p
set yi to my yy's item i
set yj to my yy's item j
repeat
if my cmp(yi, yj) then
set my xx's item k to yj
set j to j + 1
set k to k + 1
if j > jx then
set my xx's item k to yi
set i to i + 1
set k to k + 1
repeat until k > r
set my xx's item k to my yy's item i
set i to i + 1
set k to k + 1
end repeat
return
end if
set yj to my yy's item j
else
set my xx's item k to yi
set i to i + 1
set k to k + 1
if i > ix then
set my xx's item k to yj
set j to j + 1
set k to k + 1
repeat until k > r
set my xx's item k to my yy's item j
set j to j + 1
set k to k + 1
end repeat
return
end if
set yi to my yy's item i
end if
end repeat
end merge
on cmp(x, y)
(* primary comparator *)
return x > y
end cmp
local d, i, j
if xxl ≤ 1 then return
if cmp_ = {} then set my cmp to cmp -- comparator fallback
my merge(1, (xxl + 1) div 2, xxl)
end script
tell o to run
end msort
on uniq(eq_, aa, {dup:dup}) -- v0.21
handler eq_ : comparator eq_(x, y) that returns true iff x and y are considered equal
list aa : pre-sorted list
(precisely, a list organized such that any duplicate items are adjacent to each other)
boolean _dup : option whether return unique items or duplicate items
return duplicate if true, unique otherwise.
script o
property parent : {} -- limit closure to minimum
property xx : aa
property yy : {}
property eq : eq_
on eq(x, y)
(* primitive comparator *)
x = y
end eq
if eq_ = {} then set my eq to my eq -- comparator fallback
local t, x, _on
if (count my xx) < 2 then return my xx's contents
if _dup then
set _on to false
set t to my xx's item 1
repeat with i from 2 to count my xx
set x to my xx's item i
if eq(x, t) then
set end of my yy to t
set _on to true
else if _on then
set end of my yy to t
set _on to false
end if
set t to x
end repeat
if _on then set end of my yy to x
return my yy's contents -- return duplicate elements
else
set t to my xx's item 1
set end of my yy to t
repeat with i from 2 to count my xx
set x to my xx's item i
if eq(x, t) then
else
set end of my yy to x
set t to x
end if
end repeat
return my yy's contents -- return uinque elements
end if
end script
tell o to run
end uniq
--END OF SCRIPT2
In order to apply it to your current Address Book problem, replace the main() handler with something like the following one.
--SCRIPT2a (part)
on main()
script o
-- input data
property xx : {} -- list of parent; given later
property yy : {} -- list of children per parent; given later
-- work list
property pp : {} -- list of children tagged by parent; i.e, lits of {child, parent}
property qq : {}
property rr : {}
-- (0) get input data from AB
tell application "Address Book"
tell people
set xx to its id
set yy to its every email's value
end tell
end tell
-- (1) build list of children tagged by parent *)
(* omitted (same as the previous) *)
-- (2) sort tagged list by child as key
(* omitted (same as the previous) *)
-- (3) retrieve parents with duplicate child
(* omitted (same as the previous) *)
-- (4) group the retrieved people in AB
tell application "Address Book"
repeat with r in my rr
add person id r to group "duplicate email"
end repeat
end tell
end script
tell o to run
end main
--END OF SCRIPT2a
Good luck,
Hiroto
Message was edited by: Hiroto -
Contact disappeared from iPhone but not deleted from Address Book on sync
FYI, I have an iPhone 3G running iOS 4.2 (the latest), and I have never so much as thought about MobileMe.
Until two days ago, I have had no reason to doubt that my iPhone's Contact list is the same as my MacBook's Address Book list. I now have no confidence that the same info. exists in both: I know for sure that at least one contact long present in both has disappeared from the iPhone, yet syncing all contacts neither returns it to the iPhone nor deletes it from Address Book! I need help troubleshooting this contact as well as verifying that there aren't other similar anomalies corrupting my data, hopefully without manually comparing all 685 entries...
Two days ago, a certain number, let's call it (310) 555-5555, popped up in my recents list as a missed call and in my visual voicemail. When I listened to the voicemail, I discovered that (310) 555-5555 was Jane Smith. I remembered entering Jane Smith several months ago, so I thought hmmm, does she have a second number? I tried to add (310) 555-5555 to an existing entry, only to find my iPhone had no entry for Jane Smith anymore at all! I did not delete her myself, and I'm not aware of any 3rd-party app that ought to have affected the entry. I haven't called Jane Smith or (310) 555-5555 in quite some time, so I have no idea how long the entry may have been missing. I searched the whole phone (left of the first home screen)
At the next opportunity, I looked in Address Book on my laptop, and indeed found the expected entry for Jane Smith, (310) 555-5555. I have no idea how she disappeared from my iPhone -- did I or some third-party program delete her? Or did it happen through some sync issue? -- but I naturally worried that when I next synced, the deletion would sync, too, and I would lose the Address Book entry, leaving me without Jane Smith's number at all.
Such an event would defeat the entire purpose of backing up my phone contacts to my computer; I just moved to iPhone this spring after being a Palm user since 1997, and the idea that iPhone might not be reliably syncing my contacts is frankly terrifying. I checked and saw that my Address Book listed 685 contacts to iPhone Contacts's 684, so I decided to risk a sync in hopes that maybe I had caused a one-off deletion. I wrote down Jane Smith (310) 555-5555 just in case and hit sync.
The results of the sync and my subsequent troubleshooting have seriously undermined my confidence in the fidelity of the sync process. The first time, nothing changed--I still had 684 iPhone, no Jane Smith, and 685 Address Book, including Jane Smith.
Thanks in advance for any assistance.
Message was edited by: Lindsey WorthBefore conecting your phone, open iTunes on your computer and go to Preferences, on the Devices tab check "Prevent...from syncing automatically". Now connect your phone and when it appears in iTunes on the left sidebar click on its name. Go to the Info tab and confirm than your have checked Sync Contacts with Address Book. Now further down on the Info tab under Advanced>Replace information on this iPhone check Contacts. Click Apply and sync your phone. This will replace the contacts on your phone with the contacts in Address Book. (When complete you can go back to iTunes preferences and uncheck "Prevent..." to re-establish automatic syncing if your prefer this.)
-
Cannot print from Address Book! Print freezes and will not proceed.
I want to print an address list for Christmas cards. When I select the Group, select all and select Print I get the option box. I then select my printer and use the down arrow to open the dialog box that shows I am printing from Address Book and gives the different forms I can use (ie list, label, envelope) as well as the fields to include in the list. Once I have everything selected I click the Print radio button. All of the information under the Address Book options line disappears. Print remains highlighted and my printer Que never opens or appears. If I manually open the printer there is no print job showing. At this point the Address Book application is frozen. I cannot select cancel on the print dialog box (I can click it, but it does not highlight and it does not close the dialog box! In order to get out of this situation I have had to close Address Book. The quit option on the menu does work and Force Quit is unnecessary.
I actually spoke with AppleCare on this issue on Friday 05 Dec 2008. The tech I spoke with knew of no other such situations, but when I started checking on this discussion page I see a posting from REECO from clear back on 24 Sept 2008. His posting can be found at http://discussions.apple.com/message.jspa?messageID=8161605&tstart=0
The technician had me do several things. One was to pull my Caches folder out of my system Library folder. He also had me remove some Address Book preference items. The end result of these actions was a Mac Pro that would not boot! (The failure followed an Address Book crash with a "KERPROTECTIONFAILURE" and the message that some QualityMedia plugin might have created the problem!)(I could find no such plug in either on my system or via Google search!) The tech had asked me to boot to safe mode by booting while holding down the shift key untill the spinning gear appeared. The machine never progressed to a successful boot! I ended up having to use a 2nd hard drive and physically place it in internal slot 1 on my Mac Pro proceeding to reinstall Tiger! The bad news is that this did NOT solve my printing problem.
If I am attempting to print from a new install with just the Apple address card and the Owner's card in Address book the print proceeds fine. Once I import my data I am back to the same print failure.
Some diagnostic steps I have tried. I have tried USB local printers and bonjour printers. I have used Epson and Canon printers. I have tried to print to a PDF. I have tried printing from another computer (12 inch PowerBook) with identical results!
At this point I am going to call AppleCare Monday morning and see if anyone there has any more suggestions. Any suggestions this forum has will be received gratefully!I was having the same crash or "just not print" problem as seen in other posts. I was able to fix it however, by making changes in some of the address cards I was going to print. By editing the "parent", "child", "spouse" fields which will get added to the name line of the label, I was able to get labels to print (or pdf preview) without difficulty.
I did not try and determine exactly what the problem was, but basically did a data cleanup. Since I didn't know that those fields would print, I had previously included information beyond just a name in the fields, like birthdates and such, eg. "Jimmy - 12/1/05". After either removing the fields entirely where I didn't really need them, or just cleaning them down to names only, they printed just fine. I'd considered trying to disable the feature entirely but the data cleanup was not hard for a dozen or so names.
Maybe you are looking for
-
Sql developer doesn't show any packages and procedure.
Hi All, I am perty new here and I am facing a strange problem in SQL DEVELOPER. I have one schema and it has packages and functions created in it, but when I click packages or functions in sql developer it says table or views does not exist. however,
-
Calling a file and counting the number of words in it-please help!!
* @(#)WordCounterTwo.java * WordCounterTwo application * @author * @version 1.00 2007/11/17 import java.util.Scanner; public class WordCounterTwo { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String f
-
How to use Logic Pro for Windows 7?
I'm autistic, and am interesting in the music keyboards Apple sells. I would like to get Garageband and/or Logic Pro, but I have Windows 7 so I'm not sure if those kinds of software would work on that kind of system. Would they work on Windows 7, or
-
JMS message id as JMS correlation ?
I read this document: "How to Correlate JMS Messages" https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5059f110-0d01-0010-7c8b-fdc983be70c0 My scenario is AP1 -> XI -> SAP -> XI -> AP1, because AP1 sends lots of messages at th
-
Hello all! how do i save my pictures from my phone to my laptop?\
please help!