Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From a Mac OS command line, I'm looking for a command that will read my address book card and print my email address to stdout.

Doing it via an osascript command would be fine.

share|improve this question

What you are looking for is contacts.

The utility contacts gives you access to view and search all your records in the AddressBook database.

Without further ado, here are a few examples:

$ contacts -h
usage: contacts [-hHsmnlS] [-f format] [search]
      -h displays help (this)
      -H suppress header
      -s sort list
      -m show me
      -n displays note below each record
      -l loose formatting (doesn't truncate record values)
      -S strict formatting (doesn't add space between columns)
      -f accepts a format string (see man page)

displays contacts from the AddressBook database

share|improve this answer

ABFind from iHarder is your friend.

contacts (as mentioned in the other answer is great app, but its not compatible to osx versions newer than 10.7

ABFind runns just fine on 10.11 and returns a sort-of json response

http://iharder.sourceforge.net/current/macosx/abfind/

share|improve this answer
    
How does it work in 10.11 when its not compatible with OS versions never than 10.7 ? – pun Jan 23 at 10:46
1  
as i wrote "ABFind runns just fine on 10.11", contacts does not. – Nullx8 Jan 23 at 16:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.