Exporting HTML to specific file path and name

How can I set an exact filename and path for an exported HTML file? I thought I could use HTMLExportPath, but that’s a read-only attribute. And HTMLExportFileName doesn’t seem to work with a path in that value.

An example of the export I want is: /dining/2009/01/foo.html

I’m migrating content between servers so it’s important that I preserve the existing paths and names for each note.

Thanks in advance for any guidance.

Typically, you’d have a top-level container named “dining”. Inside it, there would be a container for 2009. Inside that, a container “01”. And inside that, a container for foo.

If these aren’t convenient names, you can give the notes any name, and use HTMLExportFileName to export to a different file. For example, if your note name was “➛Look←”, your file system might not like those arrows! So, you’d name the file “Look” and export to “Look.html”.

Great to see the magician!

Aw, thanks, Mark. I was afraid of that answer. Only because I have at least 1000 notes with all sorts of different paths. (They are from a Movable Type Export, which started as one big file, which I Exploded into separate notes.) Maybe I can figure out how to use Agents to create the hierarchies for me. You’ve helped to direct me away from the dead-end approach that I felt like I might be on. (That is, trying to set the output path programatically.)

This is much easier to do nowadays. One key is that we now have a create() operator that makes containers as needed, so you can create("/dining/2009/01/foo") and create any intermediate containers automatically. If a container already exists, create() uses it; if “foo” already exists, we don’t make another.

1 Like