Display rich text in a window (like Shane Stanley's WebKit Utilities?)

Years ago, I threw together a little AppleScript utility that displayed the contents of a rich-text format (RTF) file in a TextEdit window. That wasn’t elegant at all. If possible, I would like to rewrite that utility using current technology that would be able to display the RTF content in a simple viewing window - like the one that displays HTML in Shane Stanley’s WebKit viewer downloadable here:


Are there any examples of such a thing available that I could learn from?

Many thanks for any pointers.

You basically need to make an NSWindow, add an NSTextview to it, set the textContents of the view to an attributed string, and show the window. A bit tedious, but not hard.

Thank you!

What’s “not hard” for experts will probably be “fairly hard” for first-timers, but I’ll see if I can make any progress.

Meanwhile, if anyone has done this already, I’ll be grateful for a chance to study it.

Really, once you’re building interfaces like that you should look at building an Xcode project.

That’s exactly what I realized after a bit of looking. There has to be a first time…!