Add Anchor to URL


    Apr 10 2009 | 11:15 pm
    I'm trying to open a URL to a specific anchor point. I can get the URL to work just fine, but when I try to add the anchor (#anchorname), I get a "Max could not launch URL. err = -43" message.
    In other words:
    ;
    max launchbrowser "file://Macintosh HD:/Documents/file.html"
    works just fine, but
    ;
    max launchbrowser "file://Macintosh HD:/Documents/file.html#anchor"
    does not work. Yes, the anchor does exist.
    I'm guessing it has to do with the "#" sign. I've tried escaping it with both single and double backslashes with no success. Any tips? Thanks.

    • Apr 11 2009 | 1:44 am
      it has to do with the fact that the adress /Documents/file.html#anchor" simply does not exist. an anchor can only be interpreted by a browser program, max will open a file called "file.html#anchor" when you do this.
    • Apr 11 2009 | 2:13 am
      Oh, I thought the launchbrowser message launched the preferred web browser and then passed the URL on to the web browser. If I paste that address into the URL line in my browser, it goes straight to the location I want. I just assumed (yeah, I know) that would happen with the max launchbrowser message as well. Bummer!
    • Apr 11 2009 | 2:38 am
      bkshepard wrote on Sat, 11 April 2009 04:13I thought the launchbrowser message launched the preferred web browser and then passed the URL on to the web browser.
      It works. Example:
      ;
      If there's a space in the link, it doesn't work:
      ;
      max launchbrowser "file:///Applications/this file.html#section2"
      => Max could not launch URL. err = -43
      So replace the space char(s) with %20:
      ;
    • Apr 11 2009 | 4:28 am
      Perfect! Thanks PhiDjee!