getting style information from text
Mark Schonewille
m.schonewille at economy-x-talk.com
Sun Nov 30 09:20:48 EST 2008
Hi James,
Parsing the htmlText property of your field is probably the quickest
way. Find a font tag with style="bold" and then find the next </font>
tag, using offset.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Dutch forum: http://runrev.info/rrforum
Color Converter has been updated! Get it at
http://colorconverter.economy-x-talk.com !
On 30 nov 2008, at 04:18, James Hale wrote:
> Hi,
>
> I want to process some styled text to set actions depending of the
> style of the text.
>
> I have the text currently in a field and having placed it there by
> the following code snippet:
>
> set the RTFText of field "thetext" to the URL thepath
>
> This works fine and places the styled text in the field.
>
> I now want to go through this text, line by line, and depending on
> whether the line is bold or not and do one thing or another.
>
> I can do this using another field "targettext" by placing the
> RTFText of each line in turn into this field and then checking the
> "textstyle" of the field's contents.
>
> My question is, can I do this using a variable instead of this
> second field "targettext".
>
> It seems that when I use a variable instead of the field, the actual
> text placed in the variable is the raw RTF and thus the "textsyle"
> property makes no sense.
>
> So I guess I am asking if, in order to act on the style (bold or
> plain) of the text I wish to process, am I restricted to using
> fields as my containers.
>
>
> James Hale
More information about the use-livecode
mailing list