Panther’s Address Book: Can’t easily copy home page URLs in Browse mode

Posted by Pierre Igot in: Macintosh
July 8th, 2004 • 3:57 am

One day, BBEdit will support Spell Catcher X‘s interactive completion feature and let me automatically insert home page URLs from my Address Book entries by typing the first few letters of the person’s or company’s name and hitting F5…

Until then, however, I am still forced to do a lot of cutting and pasting when I want to enhance the name of a person that I quote in my blog by turning that name into a live link to their home page.

To make matters worse, however, there is a strange limitation in Panther’s Address Book when you browse address book entries and try to retrieve the contents of the “home page” field:

Contextual menu for Home Page field

As you can see in this picture, the “home page” field does have a contextual menu that includes the “Copy” command — but that command is disabled, even when the field does contain something!

The only way to copy the home page URL from an Address Book card is to painstakingly click and drag somewhere around the beginning (or the end) of the URL itself in order to select it — and hope you haven’t selected anything else at the same time.

I really have no idea why the “Copy” command doesn’t work here!

8 Responses to “Panther’s Address Book: Can’t easily copy home page URLs in Browse mode”

  1. ssp says:

    I assume the copy command exists there because the whole address book record is some strange kind of text-field like contraption. Yet you haven’t selected any text.

    AppleScript is your friend here: Try this

    tell application "Address Book"
    	set s to selection
    	set c to item 1 of s
    	set theName to name of c
    	set theURL to home page of c
    end tell
    set myLink to "" & theName & ""
    set the clipboard to myLink

    and then paste wherever you want. You could use an application’s script menu for this or LaunchBar.

    In fact, if you are using LaunchBar, it’d be even easier to navigate to the contact in question and simply hit command-C when its web page is selected :)

    The script above could also be easily converted into an address book plugin to be run from the contextual menu for the home page entry, btw.

  2. ssp says:

    I blame the stupid authors of your blogging software for not taking care that my script is published unharmed. (Even though it was in their silly alteration of a pre-tag)

    I didn’t enter any curly quotes and the second to last line should read: (fingers crossed this time)

    set myLink to "<a href="" & theURL & "">" & theName & "</a>"

  3. Pierre Igot says:

    Yeah, sorry about the limitations of the blogging software, I guess it doesn’t like double quotation marks. They all have their idiosyncratic behaviours :-/. (I could turn the auto-formatting for comments, but I am not sure it would solve the problem.)

    I ended up modifying your script somewhat, because I don’t want the extra HTML code, I just want the URL (which solves the problem with the escaped quotation marks :)). So here it is:

    tell application "Address Book"
    	set s to selection
    	set c to item 1 of s
    	set theURL to home page of c
    end tell
    set the clipboard to theURL

    Also, you must be using a beta version of LaunchBar 4, because LaunchBar 3.x doesn’t let you access a person’s Address Book card. It only lets you create a new e-mail with that person’s address.

    Anyway, I ended up saving the script as an Address Book script with Script Editor with the following name:

    ~/Library/Scripts/Address Book Scripts/Copy Home Page URL.scpt

    Then I went to System Preferences’ Keyboard Shortcuts pane and created a keyboard shortcut (ctrl-C) for this particular menu item in Address Book’s Scripts menu. And it works just fine :).

    Thanks a bunch.

  4. Pierre Igot says:

    I still feel that this default behaviour in Address Book’s Browse mode is somewhat problematic.

    There are in fact several problems. One is that the contextual menu that you get when clicking on a field label is different from the contextual menu you get when control-clicking on a field label. So presumably the additional commands in the ctrl-click contextual menus apply to the card as a whole rather than to that particular field, hence the problem with what’s selected or not.

    There is no visual indication of this, however.

    Interestingly, the contextual menu for the mailing address field has a command called “Copy mailing label”, which is effectively a “Copy” command that’s specific to the mailing address field.

  5. ssp says:

    Note that clicking on the labels on the address card is not a contextual menu click.

    (As they should) Apple made sure these menus are accessible to all (i.e. wihtout having to use extra mouse buttons or keys). While their choice for UI may be questionable, it’s not too far off what they do for the bookmark bar in Safari.

    The mailing address field only has that item in its _contextual_ menu because it is in its label menu as well.

  6. ssp says:

    BTW, I can wholeheartedly recommend the betas of LB4 ? they got me to actually buy the program. Not only do you have your whole address book and music library at your finger tips, you can also pass parameters to items and start google or imdb or (yourfavouritesitehere) searches right from LaunchBar.

    You should give it a try.

  7. Pierre Igot says:

    I am a heavy LaunchBar 3 user. I was just waiting for LB4 to come out of the beta stage. But I guess it must be pretty mature by now.

    And yes, I do think that the UI in Address Book is questionable :).

  8. Pierre Igot says:

    For the record, I’ve reported the problem with curly quotes in code to pMachine and they are going to fix it:

Leave a Reply

Comments are closed.