locating specific styles in styled text
Jeanne A. E. DeVoto
jeanne at runrev.com
Fri May 23 13:50:01 EDT 2003
At 10:52 AM -0700 5/23/03, Chris Sheffield wrote:
>Is there any way to locate a certain style in a block
>of text and then manipulate that chunk? For example,
>if I have a word that's bolded, is there any way to
>locate just that word and turn it blue or something
>like that?
The easiest way to handle things like this is to use the HTMLText property.
For example, if you want to turn all the bold words in a field blue, you'd
do something like:
on mouseUp
get the HTMLText of field "Make Me Blue"
put "<font color=" & quote & "blue" & quote & ">" into blueTag
replace "<b>" with "<b>" & blueTag in it
replace "</b>" with </font></b>" in it
set the HTMLText of field "Make Me Blue" to it
end mouseUp
--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - Software at the Speed of Thought
http://www.runrev.com/
More information about the use-livecode
mailing list