Script to batch convert Webarchives and HTML pages to RTF?

Does anyone know of a script that can batch convert a Webarchive or HTML page into an RTF file within DTP? This is nicely done by DTP v2 pb 2 but can only be done for one file at a time. I would like to apply this to hundreds of webarchived and html pages if possible. I would imagine AppleScript can do this. Please post any scripts that can do this and I will give them a try.

Thanks very much!

I need to clarify this… Actually converting a webarchive or HTML page to a Note in DTP works very well, but only on one document at time. Is there a way through AppleScript or other means to batch convert to Notes?

Thanks again.

Just select some contents and run this script. But that’s basically identical to running Data > Convert > to Rich Text.

tell application id "com.devon-technologies.thinkpro2"
		set theSelection to the selection
		repeat with theRecord in theSelection
				set theConvertedRecord to convert record theRecord to rich
				move record theConvertedRecord to parent 1 of theRecord
			end try
		end repeat
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
	end try
end tell

What would need to be tweaked to select and batch convert Webarchive files to HTML? Is this possible. I know it can be done for one file at a time, but when I select more than one, I no longer have the option of converting the webarchives into HTML files.



The next beta will support conversion of web archives to HTML.