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


Click here to return to the 'An AppleScript to look up phone numbers in Google' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to look up phone numbers in Google
Authored by: robJ on May 28, '03 02:31:45PM
Handy, and scary! I'm glad that I'm not in the phone book since it takes only seconds to find a map! I'll bet the chat room child molesters love this Google feature since all they have to do is get the victim to reveal their phone number. :-(

Here's a more user-friendly version of the script that allows one to cancel execution in all dialogs. The Finder has been taken out of the script because it isn't needed, and Safari will be brought to the front to display the result.

set fma to (path to frontmost application as string)
try
	tell application fma to set first_name to text returned of ¬
		(display dialog "enter full first name lowercase" default answer "joe")
	
	tell application fma to set last_name to text returned of ¬
		(display dialog "enter last name lower case" default answer "blow")
	
	tell application fma to set my_city to text returned of ¬
		(display dialog "Enter city in lower case, leave blank" & ¬
			" if you don't know it." default answer "my city")
	
	tell application fma to set my_state to text returned of ¬
		(display dialog "Enter state as two letter abbreviation" default answer "ca")
	
	tell application "Safari"
		activate
		open location "http://www.google.com/search?q=rphonebook:" & first_name & ¬
			" " & last_name & " " & my_city & " " & my_state
	end tell
end try


[ Reply to This | # ]
further (minor) simplifications
Authored by: cclauset on May 28, '03 11:52:10PM

Google doesn't require the search string to be all lower case as suggested by the script. Also, strip out the placeholders in the default answers (i.e., joe blow my city ca) as they are unnecessary.



[ Reply to This | # ]
An AppleScript to look up phone numbers in Google
Authored by: dica on Jun 01, '03 02:25:16PM
This simplifies considerably the AppleScript and placed in the scriptmenu will work always. (will open the user selected browser)
try
   display dialog " Please enter first name, last name, city and state abbreviattion with a space between them " default answer ¬
    " " buttons {" OK ", " Cancel "} default button 1 giving up after 30
   set full_name to text returned of the result
   open location " http://www.google.com/search?q=rphonebook: " & full_name
end try


[ Reply to This | # ]