#!/bin/ksh cd /Library/Widgets/Address\ \Book.wdgt/AddressBook.widgetplugin/Contents/MacOS stringa="687474703a2f2f7777772e6d617071756573742e636f6d2f6d6170732f6d61702e6164703f636f756e7472793d254026616464726573733d254026636974793d25402673746174653d2540267a69703d2540" echo " " if [[ -f ./AddressBook.google && -f ./AddressBook.mapquest ]]; then Kind=`xxd -p -c 256 ./AddressBook | grep $stringa` if [[ $Kind = "" ]]; then echo "AddressBook is currently set for Google Map server - changing it to use the MapQuest server..." cp ./AddressBook.mapquest ./AddressBook else echo "AddressBook is currently set for MapQuest server - changing it to use Google server..." cp ./AddressBook.google ./AddressBook fi elif [[ -f ./AddressBook ]]; then cp ./AddressBook ./AddressBook.mapquest cp ./AddressBook ./AddressBook.origional xxd -p -c 256 ./AddressBook.mapquest > ./widget.test # # robg adds: Note that the original hint contained the following replacement # string in the sed line below: # 687474703a2f2f6d6170732e676f6f676c652e636f6d2f6d6170733f713d2540 # 2b25402b25402b25402b25402b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b # 2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b # Remove the line breaks and replace it after the "/" below if you # wish to test it. Otherwise, you can remove all these comment lines. sed 's/687474703a2f2f7777772e6d617071756573742e636f6d2f6d6170732f6d61702e6164703f636f756e7472793d254026616464726573733d254026636974793d25402673746174653d2540267a69703d2540/687474703a2f2f6d6170732e676f6f676c652e636f6d2f6d6170733f636f756e7472793d254026713d25402c2b25402c2b25402b254026626f6775733d2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b/g' ./widget.test > ./widget.test2 xxd -r -p ./widget.test2 > ./AddressBook.google cp ./AddressBook.google ./AddressBook echo "AddressBook Widget replaced - now using the Google map server" echo "Run this script again to revert it back to MapQuest" rm ./widget.test ./widget.test2 else echo "Cant find the AddressBook Widget" fi echo "" echo "Dont forget in order for the change to take affect you must re-launch the AddressBook Widget in Dahsboard." echo "Just refreshing the widget via Command-R wont force the changes to take affect." echo "You can also have two copies of the AddressBook running - one with MapQuest the other with Google."