get rich text of

I’m trying to grab some Perl script HTML output and keep the text attributes, but editable in DT2. I’m using the “get rich text of” command.

My HTML has colored text in it. I’ve tried using both the “style=color:” construct and the deprecated “<font color=”, but it always turns up black in the entry.

Is there some magic I should be doing or is this simply not supported?

Trying to access the “rich text” of a HTML page converts the HTML page to RTF(D). The result of this conversion is of course static and (due to limitations of Leopard’s scripting) of limited use.

Thanks for the response, but I may have been unclear. I am generating HTML in a Perl script. I’m converting this to rich text and creating a new DT2 entry (basically, the Perl script generates a Journal template that has some information I query from the web auto-formatted).

It seems to be working as I want with the exception that some of the markup isn’t converted. I’m doing this:

set dailyData to do shell script “/Users/nall/bin/”

set theRecord to {name:theName, type:rtf, rich text:(get rich text of dailyData), date:theDate, addition date:theDate, label:theLabel}

However, only some HTML is converted (I get bullets in new entry for instance, but not colors). I’d like to get colors as well and I’m curious if that’s possible.

It might help me understand if I understood what DT2 is actually doing in that “get rich text of” call. Is it just invoking an OSX API?


“rich text” is a property of records, it can’t be applied to anything else.

ah. i thought i could use it as a free HTML -> RTF converter. oh well.

for what it’s worth, i get the behavior i want if i create a new HTML record from my Perl output, then convert that to rich text and delete the html record:

        set dailyData to do shell script "/Users/nall/bin/"

	set theRecord to {name:theName, type:html, content:dailyData, date:theDate, addition date:theDate, label:theLabel}
	set theGroup to create location "/My Group"
	set theHtmlRecord to create record with theRecord in theGroup
	set theRtfRecord to convert record theHtmlRecord in theGroup to rich
	delete record theHtmlRecord in theGroup
	set name of theRtfRecord to theName