|
Armin's Spot on the Web |
Discussion |
|---|---|
Address Book Menu Plug-In: Stadtplandienst
One of the great features of Address Book has always been that you could click on any label and functionality for the associated data. It would display the phone number in a huge font on the screen, send a mail, start a chat or display a map of the address in the browser. With Panther, AppleScript developers get a great feature: they can extend these 'label menus' with their own AppleScripts. The syntax ist straight forward and very flexible. The first scripts I saw would add a different map service and my script will do that, too, but with a twist. My favorite map service Stadtplandienst does not allow 'third-party developers' (like me) to link directly into their pages. This means that you cannot code a URL with the parameters (in this case the zip, city and street) and call that to display the relevant results pagee. Instead of allowing this direct access, this service site, require user interaction in a portal page, so you have to enter the data in a web form. Safari and AppleScript to the rescue. Safari, through an ingenius AppleScript command called What this script does is open the relevant starting page and enter the value into the form fields using javascript, then it submits the form again using javascript. This implementation will break if the service changes it's web site though, that is a drawback, but better than not working at all. This script also uses Safari, no matter what your default browser is. That might not be nice but I use the Safari scripting interface, so I have no choice. So now using Safari, JavaScript and AppleScript I can finally call my favorite map service directly out of Address Book. I posted the code below for clarity, but this will only work on Panther anyway, so you might as well click here to have the script appear in your Script Editor. You now need to save the script as a 'Compiled Script' with the extension Also take a look at the Postleitzahlen Plug-In Update (15. April 2004): I noticed that Stadtplandienst changed their web appearance and the page now takes a little longer to load. I adjusted the |
|
This page was last updated: Thursday, April 15, 2004 at 2:00:53 PM Copyright 2010 RSVP - Please Reply Mail me @ arminbatmacdotcom |
|