• 0 Comments
  • 0 Recommendations

Mac OS X Hints Page 2 of 2

Help Desk

Google Your Contacts

Ever want to quickly run a Google search on one of the contacts in your Address Book list? Download our script, and then drop it into the your user folder /Library/Address Book Plug-Ins folder (if this folder doesn’t exist, create it).

Now launch Address Book and control-click on any contact’s phone number. You’ll see a Google Them option in the pop-up menu (See screenshot). Select it to open Safari, load Google’s page, and start searching for your contact’s name. If you want something more interesting than a Google Them label on the pop-up menu, you can change it by editing the words inside quotation marks in the line that reads

return "Google Them"
in the script. (You’ll have to have a phone number entry for your contacts, as you can’t associate a script with the Name field.)

Unix Tip of the Month

Do you have friends scattered about the globe? And do you have trouble remembering whether it’s yesterday or tomorrow in Australia? Terminal and some handy commands can help you avoid accidentally calling a friend in the middle of the night.

OS X includes time-zone information for a huge number of locations. To see what’s available, open Terminal, type

cd /usr/share/zoneinfo
, and press enter. Then type
ls
and press enter. (You can find the same information in the Finder if you select Go: Go To Folder and type
/usr/share/zoneinfo
in the Go To The Folder box.) You’ll see a large list of directories and files. Within the folders are the names of cities in each geographic area—Europe contains Amsterdam through Zurich, for example.

Now that you’re suitably impressed by the collection of time zones, how can you put this data to good use? By employing the

env
command and the
TZ
variable, which sets the working time zone for your machine. The
env
command lets you run any other command with environment settings that may differ from those you currently use. To put it another way,
env
lets you run programs in a mode that differs from the mode in which you would normally run them. In this case, we’re going to set the
TZ
variable so that
env
thinks we’re in a new time zone, and then have
env
run the normal Unix date command as if we were in that time zone.

The

TZ
variable is defined by the names of the files and folders in the /usr/ share/zoneinfo folder—the folder name comes first, then a slash, and then the city name within the folder. So to see the date and time in Reykjavik, Iceland, you’d type
env TZ=Atlantic/Reykjavik date
.

Press enter to see the current date and time as if your machine were located in Reykjavik. To change locations, just repeat the command with a new folder and city—

env TZ=US/Hawaii date
, for instance. If you check times around the world often, you might want to use an alias to make it easier. Using a Unix editor or a pure text editor, open the invisible .bash_profile file at the root of your user folder (or create it if it’s not there already). Add an alias line for each location you want to create—for example,
alias hawaii='env TZ=US/Hawaii date'
for Hawaii.

Save the file, quit the editor, and then type

source .bash_profile
. Press enter. Now type your alias (
hawaii
in this example) to see the date and time for the location.

Using a simple Address Book plug-in, you can quickly find out what Google knows about any of your contacts.
  • Recommend? 0 YES 0 NO
  • 0 Comments
  •  
  • Print

Latest News on Macworld