libs-steptalk/Examples/AppKit/rtf2text.st
Adam Fedor c2c2d22254 Initial revision
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@13642 72102866-910b-0410-8b05-ffd578937521
2002-05-13 22:13:06 +00:00

29 lines
532 B
Smalltalk

"
rtf2text.st
Convert RTF document to plain text.
ussage: stexec rtf2text infile outfile
"
| infile outfile rtfString |
Environment loadModule:'AppKit'.
((Args count) < 2)
ifTrue:
[
Transcript showLine:'rtf2text: Please specify input and output filename'.
]
ifFalse:
[
infile := Args @ 0.
outfile := Args @ 1.
rtfString := (NSAttributedString alloc)
initWithPath:infile documentAttributes:nil.
(rtfString string) writeToFile:outfile atomically:YES.
]