Customizing "export as website" in DTPO?

One of the main uses of DTPO for me is collecting snippets of information in public policy (I am a political scientist). I treasure DTPO’s capability of searching my databases in complex ways, and the results are invaluable for me.

To share results and for other purposes, I have started to think about exporting DTPO content as a website (I haven’t used this yet in my several years of using DTPO, so please excuse my ignorance on this).

Apparently, DTPO does export all the records brilliantly; however, there are a few things that I miss, and my question is whether the following would be possible:

  • to get an index.html page from which all exported records are linked, using their title as link (a table of contents of the website, so to say);

  • ideally, I would like to be able to also select variables of the records to be put next to the link, such as the date of creation (if sorted on that variable, this would easily create a sort of timeline or historical development of the issue in question);

  • it would be wonderful if I could get prompted for the title to be given to this exported website, which would also be displayed as a title on the index page.

I hope I have presented clearly enough what I want. And I would be most grateful if anyone had an idea how I can realise this – either through abilities of DTPO which I have not yet discovered; a customized template for html export (help only indicates the existence of very few variables in that respect and does not explain them sufficiently); or some AppleScript magic…

Many thanks for your help!


If I may add something to my above question:

I have just found out (through exporting as website with the template “footer + header” or “header + URL + Comment” that the HTML pages thus created contain all the information I need (namely the title and the creation date of the record).

So DTPO must know those variables and be able to export them. But how do I access / modify the templates used? And how could I create an index.html page? Searching the forum has shown me that I am not the only one to search for an answer to these questions, so I hope plenty of solutions will be unveiled in this thread :wink:

Thanks and best wishes,


Hi – it’s me again :wink:

I have looked into this further, and it seems doable. If I could write AppleScript, I would whip up a script now; but – alas! – I can’t.

So here is some pseudo code (I am not a programmer!) to sketch a solution; perhaps someone on the forum is bored and capable – and surprises us with a script… The variable names are from Application Support/DEVONthink Pro 2/Websites !

for all selected items
open “index.html”
append newline; %title%; %modification%
close “index.html”
open file i
write %content%
close file i
increment i
next item

(Don’t laugh at me – it’s been 20 years since I read Wirth on Pascal :wink: )

I hope those more capable than I get the idea. This would create a file “index.html” containing the links to the individual files, and besides that export the files normally into html format.

Best wishes,


I posted a proposed solution to your request in the Scripting forum



korm – thanks a million for your help and this brilliant script!

It almost does what I need, for it creates an index page. This page references the URLs, which means it needs internet connectivity (plus in certain cases a login for paid content to be accessible).

However, I would like the exported website to be “stand alone” so I can pass it on and / or use it while offline. I tried replacing “URL” with “location”, but then the DTPO database is required which also goes against the “stand alone” requirement.

When exporting to a website in DTPO, all the files are exported as HTML anyway; would it be possible to refer to those rather than “URL” or “location”? That would be great.

Any ideas / help with the code will be very welcome!

Many thanks again!


Good luck with that. I did my piece.

Hi, just to say thanks again to everyone who helped. Due to that (and a little bit of experimenting) I have managed to come up with a script that does what I want. You can find it in a different thread:

Thanks again for all the help I received!


The links for the scripts mentioned above fail. Any chance they can be refreshed to point to the scripts, which sound rather useful?

11 years ago! Have you first tried searching?

I don’t know the name of the script. It’d be great if the script would work with DT3, but I’d be happy with the script logic and the DT3 appleScript references!