Add Anchor to URL

Apr 10, 2009 at 11:15pm

Add Anchor to URL

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.

#43311
Apr 11, 2009 at 1:44am

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.

#155330
Apr 11, 2009 at 2:13am

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!

#155331
Apr 11, 2009 at 2:38am
bkshepard wrote on Sat, 11 April 2009 04:13
I thought the launchbrowser message launched the preferred web browser and then passed the URL on to the web browser.

It works. Example:

;
max launchbrowser “file:///Applications/file.html#section2

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:

;
max launchbrowser “file:///Applications/this%20file.html#section2

#155332
Apr 11, 2009 at 4:28am

Perfect! Thanks PhiDjee!

#155333

You must be logged in to reply to this topic.