How to read RTF,DOC etc. files

Hi,
I am wondering on how to read files with styled text such as RTF or DOC.

Reading TXT files is easy:

set file_ to (choose file)
read file_

But if I try to read RTF files I get this for example:

"{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fnil\fcharset77 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh8000\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural

\f0\fs24 \cf0 test text}"

I want to get the real content and not the raw source - but how?

Thx Vince

One approach would be to parse the RTF, but that’s a painful, time-consuming process.

Instead, a better approach would be to use some app that understands RTF (such as TextEdit) and use its abilities:


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Thx!

That’s what I am doing right now :slight_smile:
I thought there was a finer way :lol:
But thanks anyway!

Vince