How can I strip away formatting from an RTF file?
ambassador at fourthworld.com
Wed Jul 8 19:58:15 CEST 2015
Devin Asay wrote:
> On Jul 8, 2015, at 11:24 AM, Gregory Lypny wrote:
>> I imported an RTF file and put it into a field using
>> set the RTFText of field "File Text" to url ("file:" &
>> Of course, the text in the field is formatted as in the file that
>> was imported. How can I import the text while stripping away the
>> formatting, which I do not need?
> Just ‘put’ the text of the field into another field or variable:
> put fld “myRTF” into fld “myText”
> Putting text never preserves formatting.
> Another trick I’ve learned (unless it’s been changed recently) is
> that using ‘replace’ on a field strips formatting.
> replace space with space in fld “myRTF”
Setting the field's contents as with your first example would be the way
I would recommend.
Replacing a single character should ideally only affect the text style
for that character, even if it occurs in multiple places, so personally
I would consider the second example a bug if it strips all styles from
unaffected portions of the text.
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode