mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-23 19:40:55 +00:00
30 lines
532 B
Smalltalk
30 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.
|
||
|
|
||
|
]
|