Address Book - find and display person

I want to check whether a person in my database is also in the Address Book. I am using:
tell application "Address Book"
set theCount to 0
set firstName to "Joe"
set lastName to "Public"
try
set theCount to count (every person whose (first name is firstName) and (last name is lastName))
end try
if theCount is 0 then
display dialog "no person found" buttons {"none"} default button 1
else
set thePerson to (first person whose (first name is firstName) and (last name is lastName))
-- display the right card here
display dialog "Person found" buttons {"OK"} default button 1
end if
end tell
This finds the correct person if they exist, but the displayed record is not changed. Anyone know the trick?
PowerMac G4 MDD   Mac OS X (10.4.5)  

Paul Berkowitz, a rather brilliant AS scripter, suggested the following trick:
open location "addressbook://" & theID
theID being the unique ID of a person in addressbook.
so...
--begin script
tell application "Address Book"
set theCount to 0
set firstName to "Joe"
set lastName to "Public"
try
set theCount to count (every person whose (first name is firstName) and (last name is lastName))
end try
if theCount is 0 then
display dialog "no person found" buttons {"none"} default button 1
else
set thePerson to id of (first person whose (first name is firstName) and (last name is lastName))
my ShowPerson(thePerson)
display dialog "Person found" buttons {"OK"} default button 1
end if
end tell
on ShowPerson(theID)
open location "addressbook://" & theID
end ShowPerson
--end script
The reason I used a handler (the on showperson bit) is that the open location is not understood by AddressBook, so I "outsourced" that bit to a handler.
HTH,
J.

Similar Messages

  • Address book: Find and replace characters?

    Hi all,
    I just imported VCF file from Outlook to Address book. I am in Iceland and the Icelandic characters came wrong. Is there any way to batch find and replace characters in Address book? That is in individual cards.
    Thanks,
    Hilmar

    I believe the only way would be to write an AppleScript.

  • Address Book template and Exchange server

    We're in the process of upgrading about 250 Macs from OS 9 to Mac OS X 10.4.3 at my work. We're now binding our Mac workstations to the Active Directory and having folks log in against the network. One byproduct of this is that the Apple Address Book now can search/display folks in the Exchange Server's Global Address Book. However, the template that the Address Book uses to display each person's information is pretty limited. We get the full name, LAN ID, a business group, a location/building, a "work" phone number (which is an internal number) and the internal e-mail address. The Global Address Book contains significantly more information than this, including a true local phone number. In Outlook, this field is defined as a "Business 2" phone number. Editing the default Address Book template does not seem to allow any of this additional information to be displayed. Is there somewhere else that we could edit a file so some of these options are mapped correctly to the Apple Address Book?
    -Doug

    The template preference should work for you. If you hit the green + button you can add fields with all kinds of different default names. If those field names don't match your needs you just select the field name (the bold typeface one) and scroll down in the resulting box and use the "custom" field to add any title you wish. It should change the name of that field to the name you wish to use and that will match the named fields you all area already used to using. You can do this with any field so you should be able to match any fields you wish.
    I hope I understand your question correctly. If not...sorry.

  • Address Book template-to-display oddity..

    (Hi! I first posted this query in the Leopard>Mail and Address Book Discussions, but there's been no response there, so I thought that there might be a greater chance of a response from those with Tiger experience and expertise..)
    I've spent three-quarters-of-an-hour searching through previous posts to see if this has appeared as a problem before, but can't find any mention here in Leopard nor Tiger Discussions..
    I'm asking on behalf of my beloved, who's tearing her hair..
    She's created an Address Book Template (Address Book>Preferences>Template) and has successfully imported records from Filemaker (by using 'Address Book Importer').
    HOWEVER, although she's created (or renamed) fields in the Address Book template, such as
    home page
    birthday
    last changed
    Data in/change
    C1
    C2
    work done
    practitioner
    etcetera (..those C1 and C2 are Comment fields..) nevertheless when data's been imported (and it does all import OK!) some of the fields shown in her Address Book cards are displayed in a different order.. e.g;
    home page
    birthday
    last changed
    Data in/change
    C1
    work done
    Admin info
    category
    flat
    C2
    ..etcetera. In other words, the C2 field, for instance, is displayed far further down the fields list than it is in her template, where it sits just beneath C1!
    This doesn't seem to be based on some peculiar alphabetical or alphanumeric sorting of the fields or the data within them, and when all fields have data in them then that re-ordering is consistent ..e.g; C2 is always separated from C1 by having 'work done', 'Admin info', 'category' and 'flat' between them. ("Flat" is an address field; in the UK "flat" means "apartment".)
    We don't seem to be able to find any re-ordering facility which would bring back the display into the same order as the template.
    Is there such a facility to re-order the display, apart from re-ordering the template on a kind of hit-&-miss basis until it sticks properly in the cards display? ..And has anyone else come across - and solved? - this problem of fields being arbitrarily(?) re-ordered in the display?
    Many thanks in advance..!

    The template preference should work for you. If you hit the green + button you can add fields with all kinds of different default names. If those field names don't match your needs you just select the field name (the bold typeface one) and scroll down in the resulting box and use the "custom" field to add any title you wish. It should change the name of that field to the name you wish to use and that will match the named fields you all area already used to using. You can do this with any field so you should be able to match any fields you wish.
    I hope I understand your question correctly. If not...sorry.

  • Unsure of what happened to my address book, mail, and app store?

    My address book, mail, and app store are missing! Did they come with the computer when I bought it? (I have Mac OS X 10.6.8 and I bought it about 2 years ago) They all have different problems when I click on them. For starters, they three look like this in my app folder
    Then, when i click my address book, it comes out all smushed like this: ( i had to crop out much of the image due to personal information, but all information and links are smushed)
    The app store, when clicked, force quits immediately.
    & lastly, the mail will not even open. no blank screen, no force quitting apple message, nothing. infact, to quit the mail program, i have to force stop it myself.
    I really want to use these things and I just don't understand why they dont work, shouldnt they be included with my computer? that's the impression i was under, i didn't know i had to purchase the app store, mail, or address book? why wont they show up and what can i do to fix this?

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box. Don't use the Safari-only Guest login created by Find My Mac.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. The Guest login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, or if a firmware password is set, you can’t boot in safe mode.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • How can I delete ALL of my Address Book entries and start fresh?

    Yes. I know that sounds extreme, but……
    I use Outlook on a PC at my office, and I have an sbcglobal/Yahoo mail account. I look upon my office Outlook as my ultimate contacts list (over 1,100 entries) and my calendar.
    I use the sbc supplied free Intellisync software to sync all of my calendar and contacts from my office PC into sbc/Yahoo. That way I actually get e-mail reminders of appointments, etc. in addition to my Outlook notifications. It is actually pretty nifty.
    I have also successfully signed-on to my Yahoo account at home on my MAC and exported all of my contacts from Yahoo (which had been populated by the PC Outlook listings via Intellisync) onto my desktop and then imported them into Address Book. But I did that some time ago and now my Outlook listings have been updated rather substantially. I would like to able to do a complete re-install of the new and improved contacts from the Yahoo repository.
    Again - I certainly do not want to delete the Address Book app itself – I just want to start with a clean slate so there are no conflicts or duplicate entries (which in fact is seemingly a bug in the Yahoo/Intellisync. Is there a way to completely wipe clean all of my Address Book entries?
    Thanks
    Theo
    G4 (FW800) Mirrored doors Mac OS X (10.4.8) Dual 1.42GHz; 1.5GB DDR SDRAM; 20" HD Cinema Display; iSight;

    Hello Allan -
    Your help on a previous post was great re: my wanting to know how to delete the Address Book contents so I can re-import an updated list form my office Outlook, via my yahho/sbcglobal import.
    Well - here is an interesting quandary:
    I have successfully exported my yahoo address book/contacts as a .vcf file Yet - once I have expunged the prior Address Book data and want to now import the NEW Yahoo data to rebuild the database it only takes (enters) the phone numbers and does NOT import ANY of the address information. I am positive I did this once since our original exchange and everything transferred just fine, but now….?!
    What I cannot determine is where the fault may be: does the export NOT include the addresses (in which case I am doing something fundamentally stupid wit the export) or the vcf cards are complete, but Address Book is not “seeing” anything other than the phone #s and e-mail addresses.
    Any thoughts?
    Dazed and confused
    Theo

  • Address Book Sync and SyncServices

    Anyone know what "Sync Services" are and why it keeps loading and running "Address Book Sync" and eating up 100% of my Intel CPU? What is this "syncing" with and why? Did my trial subscription to .Mac do this?

    Thank you for the quick answer. This looks like something that is programmed into the iLife suite of applications (Address Book, iCal, etc...). I can't find anything on my machine (via Spotlight) that suggest an application that manages this or allows you to turn it off.
    I think the reason for the high CPU utilization was my importing a 16,000 entry tab-delimited contact file into Address Book. I guess the Sync framework was busy distributing these new entries to all the other iWorks applications. It's quiet now, so I guess it launches itself when it sees the need to "sync-up" it's other member applications when data changes in one of them.
    Thanks again for the help!

  • Finder can not  find and display certain files. Why? Any fix,please?

    I've discovered to my surprise that Finder can not  find and display certain files. Computer is Mac book OS X (10.6.8)
    No matter what Finder settings I use, there are files which it can not detect and display.
    Here are just some examples of files sitting in the HD but Finder can not display them:
    Located in  preference panes :
    fibre channel 1.7
    Located in :    /Library/StartupItems/BRESINKx86Monitoring
    BRESINKx86Monitoring
    FxLicenseManager
    Located in    /Library/StartupItems/FxLicenseManager
    EAP8021X
    Located in    /System/Library/PrivateFrameworks/EAP8021X.framework
    The questions:
    What to make of this inability of Finder to ,well, find? (again - I tried all possible settings of Finder!)
    Is there any way to fix it?
    Thanks for any competent suggestion!

    Well, guys,
    Interesting suggestions but the problem remains -Finder (aka Spotlight) is not capable to find certain files.Period.
    I consider it as a fault of the system because in comparison, a search facility of a plain Windows based machine is capable to dig out and display any file, no matter now deeply hidden...
    As far as the suggestion above by softwater  goes , well, I've used the additional foptions  extensively and nothing produced the result needed -that's why I created this discussion.
    If someone still believes that using Finder with all its options is good enough, here is a test for you to perform on your own Mac:
    -Open  /Library/StartupItems/ and have a look inside - most likely you have a bunch of items. Write down the names of one or two of them. For this test I've chosen
    FxLicenseManager  located in    /Library/StartupItems/. You can use any file you want grom this location...
    - Then go to  Finder and set it to display everything in Library of the HD. Remember - for this test you pretend you don't know any file name in this folders.
    If the Finder works properly it shall display  folders  of Library >Startup items with all stuff inside, including the FxLicenseManager file I used for this test.
    Finder displayed nothing. It is obvious that for Finder, certain locations are off limits. That's why I consider Finder as a faulty.
    Of course if someone can set the Finder's  options to do the above search and succeed, I'll be glad to try ...:-)
    At this point, what I gather from this discussion is that :
    1. Finder (Spotlight) feature is not to be trusted,despite number of fancy but rather useless options.
    2. If you need to really find everything usually not displayed by Finder you better get real  searching software.

  • HT4910 I tried to update my address book on OS X6 with an abbu from my other computer which has Lion OS X 7.  It wiped my address book clean and I cannot retreive by Address book on my OS X 6 computer and saves out there?

    I tried to update my address book on OS X6 with an abbu from my other computer which has Lion OS X 7.  It wiped my address book clean and I cannot retreive by Address book on my OS X 6 computer and saves out there?

    blacksheepfibers wrote:
    I updated my mac with  os x Lion so that I could accomplish moving my address book from the mac to my new IPad 3G. I also set up an icloud account for this purpose, but I *still* cannot figure out how to move my address book from one computer to the other. When I'm on my mac and try to use bluetooth to export the address book, I'm able to find my ipad but I soon get a message that it does not support the necessary services. I have no idea what's going on and would appreciate any advice. tks in advance, Sarah
    The address book syncs via iCloud, not Bluetooth or iTunes.
    You upgraded to Lion so you could use iCoud.
    On the computer. go to Apple menu > System prefs > iCloud.
    Sign into your iCloud account.
    Tick everything.
    This enalbes the se items syncing to iCloud.
    On the iPad, Settings > Mail, Contacts, Calendars.
    Create a new iCloud account.
    Sign in with the same AppleID as your computer.
    Settings > iCloud and turn everything on.
    BAM!
    That is all you need to do.
    Your contacts (and all other checked items checked) will sync between computer and iPad.
    No need to use iTunes

  • Lost my address book entries and current mail program.

    I recently installed Leopard on my G-4 and was not satisfied with it so I attempted to downgrade back to Tiger. In order to do this I had to reinstall Panther which I did, only I lost all my user settings, etc., even though I had checked the box to save. When my desktop appeared, my address book and mail program was empty. I backed up my mail program but have been unable to access my mail from 2007, only up to 2006. I went to Previous Systems, but again, only up to 2006. I have been all over my hard drive looking for my old address book but haven't found anything. Would my old address book still be there and if so, where? And how can I access my mail from 2007, even on the program that is backed up?
    Any help on these two topics is greatly appreciated.

    Hello Allan -
    Your help on a previous post was great re: my wanting to know how to delete the Address Book contents so I can re-import an updated list form my office Outlook, via my yahho/sbcglobal import.
    Well - here is an interesting quandary:
    I have successfully exported my yahoo address book/contacts as a .vcf file Yet - once I have expunged the prior Address Book data and want to now import the NEW Yahoo data to rebuild the database it only takes (enters) the phone numbers and does NOT import ANY of the address information. I am positive I did this once since our original exchange and everything transferred just fine, but now….?!
    What I cannot determine is where the fault may be: does the export NOT include the addresses (in which case I am doing something fundamentally stupid wit the export) or the vcf cards are complete, but Address Book is not “seeing” anything other than the phone #s and e-mail addresses.
    Any thoughts?
    Dazed and confused
    Theo

  • 5 crashes after upgrade to ios my address book immediately and I can not access emails, because the password is wrong and when I go to mail settings crashes the application immediately from

    5 crashes after upgrade to ios my address book immediately and I can not access emails, because the password is wrong and when I go to mail settings crashes the application immediately from 

    Same issue also. Occurring both on my iPad 2 and iPhone 4 after upgrading to ios 5
    By the way, Mattban and Sancasslano, are either of you also experiencing any of the following issues:
    * Problems with Contacts either crashing or listing no names
    * Problems with turning iCloud on or off for application under Settings->iCloud... On both mine I just get a pop up saying that iCloud is being turned off but Contacts then just locks up.
    * General problems when trying to synch applications on the iPad or iPhone over iCloud?
    I am wondering if all these issues are in someway related to and whether it is worth trying to turn off iCloud somehow, though I cannot work out how this can be done once set up.

  • How to Sync Address Book, iCal and Safari bookmarks with Blackberry Storm

    I recently purchased a Blackberry Storm and have been trying to sync my Address Book, iCal and Safari bookmarks without any luck. I downloaded the PocketMac SyncManager from BlackBerry but the sync fails when I connect the Storm to my MacBook Pro. Any suggestions as to how one gets this to work?

    I read that Mark/space had problems and wasn't working very good..
    http://discussions.apple.com/thread.jspa?threadID=1792905&tstart=0
    Though I did see a thread using Google mail -Take a look at that .
    http://discussions.apple.com/thread.jspa?messageID=8660300&#8660300
    Brad

  • Address Book, iCal and Gmail

    I would like to make Gmail my default source for Address Book entries and iCal entries on my Intel Mac running Lion and my iPad. There seems to an 'almost' option in Address Book when setting up for Gmail, however, it only states my mac

    I have heard a lot about how the new 2.0 software will work with Microsoft exchange, but i have heard nothing about how it will work with ical and address book, or if gmail users will get any added email benefits.... so someone please give me some good news....
    How it will work with iCal and Address Book in what way? With over the air syncing?
    If so, only with Apple's new Me.com service which is replacing their .Mac service. This will provide over the air syncing for contact information and calendar events between iCal and Address Book on a Mac, with the iPhone, and when accessing your Me.com account via Safari on any Mac, or with Safari or a supported browser on a Windows PC. The Me.com account will be push email.
    Regarding any added benefits for a Gmail account, I don't believe so, unless Gmail plans on adding some benefits such as push-IMAP account access.

  • Address book freezes and loses cards

    While entering a new card, the address book froze and after forcing quit, all the cards were gone. Fortunately most were back-upped. Any ideas, an Intel virus perhaps, that's a joke.
    Jim Easton
    Power Book Pro   Mac OS X (10.4.5)  

    Hi,
    I followed your suggestions from the thread linked below, unfortunately it didn't do the trick... I just lost a no backup addressbook after the compter froze while entering a new contact. I'm hoping the corrupt/lost file is floating somewhere, waiting for me to dig it up. What do you think? Thanks!
    G5 Dual 1.8gHz; Powerbook G4 1.5gHz   Mac OS X (10.4.6)  

  • Address book app and Addresses pane in Mail not synced

    Address book app and Addresses pane in Mail not synced
    I add a contact to Address Book app eg [email protected], this address is not imediatley available to use in Apple Mail app.
    The address [email protected] eventually appears in the Address panel in Maill app, it can take from 3 minutes to hours to appear, surely both apps are reading the same database.
    This is particularly problematic when adding new contacts to groups and then emailing that group, Im never sure the group in Mail app is the same as the group in Address Book app.
    Nothing seems to speed up this process ie quitting and re-opening Mail app or Address book app.
    I have tried deletting "AddressBook-v22.abcddb" ~/Library/Aplication Suport/Address Book
    I have tried forcing ~/Library/Aplication Suport/Address Book to re-index.
    I have also restarted, repaired permissions, ran fsck -fy in single user mode.

    Because the sender has their name as part of the email address that is sent, and when they send you a message that matches the one in your Address Book, it's updated to show their name as Mail received it. But if you had previously sent them email before that update occurred, then your Previous Recipients database in Mail doesn't use that newly updated information in Address Book.
    Mulder

Maybe you are looking for

  • How to get all the fieldnames from a tcResultSet

    Hi, im coding a connector to write to a file all the fields of the process form. to be like this: User ID: value for UserID FirstName: Value for first Name LastNAme: Value for LastName Im using the Process instance Key to get the tcResultSet. I know

  • How do I get this to run only once

    I am using Labview and an E series DAQ to control a stepper motor. I downloaded a finite pulse generator to send out the number of pulses I need when a case is selected, but now my problem is that the vi keeps repeating the finite pulse generation, s

  • Problem while posting to accounts on vendor account

    Hi experts, We have a wagetype "Advance deduction" For the particuar employee we created a vendor account. We ran the payroll successfully and  we tried to post it to accounts. Im getting the errors  ""No creditor with serach key  Companycode  LFB1 P

  • Getting HDMI audio working (ASUS P5E-VM HDMI mATX)

    Hey everyone. So I'm trying to create a HTPC using this ASUS P5E-VM HDMI mATX motherboard with a 3.0 GHz E8400 Core 2 Duo and 4GB RAM. I've installed Arch 64-bit on it and have full 1080p video showing nicely on my HD TV with Gnome set up quite nicel

  • Adobe illustrator problem: stroke path

    I Have problem with adobe illustrator. I have made a path, out of other paths, and now I want to stroke it. But it strokes at each little path. I have a print screen to make it more clear: The question is: How do I stroke the whole "A"? So i just get