Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Name Lookup' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Name Lookup
Authored by: macman13 on Jun 09, '03 06:40:55PM

Just to rip you off slightly (since I am not a very experienced programmer):

#!/bin/sh

if [ $# -ne 2 ]; then
echo 1>&2 "usage: abook phone YOUR_SEARCH"
exit 127
fi

scriptcode="tell application \"Address Book\"
set thePerson to person \"$2\"
set theProps to the properties of thePerson
set the firstName to the first name of theProps
set the lastName to last name of theProps
set the phnList to the value of every phone of thePerson
set testList to firstName & \" \" & lastName & \" \" & phnList
return testList
end tell"

osascript -e "$scriptcode"

exit 0


This borrows from your script and a safari script to display the phone numbers of the person being named.

ie.
abook phone "Desired Name"

Displays:

Desired Name Phone number

This should do the same as the pb script except that you would still have to add a new name and phone number using the addressbook gui. But this would find a phone number in the terminal from a name.

Any more ideas?

Thanks.
SA

---
\\\"I can do everything on my Mac I used to do on my PC, plus alot more ...\\\"
--Me



[ Reply to This | # ]
hazzah!
Authored by: macubergeek on Jun 09, '03 09:58:09PM

now this works!
many thanks!



[ Reply to This | # ]