Create an html file and launch it

I create a text file called mytest.html in a folder chosen by the user.
In the same folder, I save a few pictures, referenced by the page.

the first few rows of the file:

[code]
Page Title

Some text

[/code]

After its created, I call f.launch

Web browser opens, but the pictures are not displayed.
The browser bar displays file:///.file/id=6571367.11638908

Yet if I open that folder, and double click the mytest.html file, the images are displayed properly, and the browser address bar shows the correct filename.

How do I get the browser to ‘use the right working folder’ so that it sees the local images?

edit: currently testing on mac but will be multi-platform

The images need to be relative to your html. Same as for all html. There is nothing special with using local html. Open the html in a html editor and fix the links there. Even better use Rapidweaver or similar to create your html so that the links are created automatically.

The images need to be relative to your html.

is a relative link, isnt it?
I can get them to display if I change it so that they are NOT relative to the html file, since it can find them if they are at a named location.

I’m creating the HTML and the content at runtime, to produce a single html file.

On the mac, when the default app for html is Safari, it opens with this unusual file reference
file:///.file/id=6571367.11638908

When I change the default app to Chrome, it fails to open the file at all, with a message to say that the file has been moved.
That file id looks like a temporary file to me: I dont understand why it isnt getting the file path when I use f.launch, in the way that a .doc or .xls, or .txt file would

Chrome is a different problem because Chrome needs to protect you from your own files!

Okay. I made a very simple html file with just

[code]

[/code]

Loads just fine.

So does mine.
Unless I use myfile.launch in code

How are you launching yours?

Perhaps using ShowURL instead of Launch would work better:

ShowURL(MyFile.URLPath)

Thanks Paul. That works.
Id tried a few variations on SHOWURL previously, prefixing with file:// and using nativepath and absolutepath
but the URLPath does the trick!