On Fri, Nov 30, 2018 at 7:08 AM Kaveh Bazargan via use-livecode <
[email protected]> wrote:
> But here is a follow-up: Now I want to hide all lines that have no text
> style and only show lines with colored text. I use:
>
> repeat with i = 1 to the number of lines of fld 1
> if the textcolor of line i of fld "text" is not empty then
> set the hidden of line i of fld "text" to false
> end if
> end repeat
>
> This is taking time too. Any suggestions how to speed this up?
>
Try working with the styledText property.
```
put the styledText of field "text" into tTextA
# loop through paragraphs
repeat with i = 1 to the number of elements of tTextA
# Check if first run has textcolor set
if tTextA[i]["runs"][1]["style"]["textcolor"] is not empty then
# hide paragraph
put true into tTextA[i]["style"]["hidden"]
end if
end repeat
set the styledText of fld "text" to tTextA
```
--
Trevor DeVore
CTO - ScreenSteps
www.screensteps.com
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode