|
|
Command Line lookup for Address Book
How about this possibility? Do a search of the OS X Address Book from the command line.
Here's the shell script:
Remove the -s "s" part to get a simple comman-separated list, rather than an AppleScript list of strings.
update - improved results
Save this into a file named abook, then do a chmod 755 abook to make it executable. If you put it in a folder in your $PATH, make sure to rehash to allow your shell to find it. The usage is:
This version returns a line-delimited list of names, rather than an AppleScript list of strings:
Any hard-core shell-scripters out there with advice on improvements are welcome.
script dosn't work
jamesk @ /Users/jamesk/desktop@Xmac-->./abook
script dosn't work
What shell are you using? Hmm, actually, that should not matter, since my script specifies the shell to use.
script dosn't work
I've made my script mirror what I see on the web page, no luck.
script does work
I've seen those error messages when trying to use applescript from the commandline, when my user isn't the logged in user. If that's the case, use it with sudo to get around it.
script does work
I was trying to do it over ssh connection.mebbe that was it?
update - improved results
From what I see this returns the name of an email or phone number. Would it not be better to have the search name based and have it return the phone number? Or am I missing something here?
Name Lookup
You're right. This version lets you search by partial-name (asking for email or phone), returning a list of all the possible matches and their email/numbers:
Name Lookup - caveat
Of course, if you want to search Business records by the person's name, you'll have to search by that, too. For now, it searches by the card's name, which would be the Company name if you've specified the card as a Business.
Name Lookup
Just to rip you off slightly (since I am not a very experienced programmer):
hazzah!
now this works!
Name Lookup
formatting on this is unuseable...sorry but I'm at a loss for reconciling what I see on the web page with something that will work in shell.
Name Lookup
weird...what web browser are you using? I used the code tag for posting here, as required. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|