I would like to set textstyle "bold" of all words after the character ":"
example my field:
Lorem Ipsum: is simply dummy text
Film:
The point
The point1
The point2
The point3
Sound: exmple1
thank you
set textstyle bold
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: set textstyle bold
This is a good example of brute-force coding. Put your text into fld 1. Make a fld 2. Put this into a button:
I recommend testing this...
Craig Newman
Code: Select all
on mouseUp
put fld 1 into fld 2
repeat with y = 1 to the number of lines of fld 2
switch
case char -1 of word 1 of line y of fld 2 = ":" and the number of words of line y of fld 2 = 1
put "bold" into tStyle
break
case char -1 of word 1 of line y of fld 2 = ":" and the number of words of line y of fld 2 > 1
set the textStyle of word 2 to (the number of words of line y of fld 2) of line y of fld 2 to "bold"
break
case line y of fld 2 <> ""
set the textStyle of line y of fld 2 to tStyle
break
end switch
end repeat
end mouseUp
Craig Newman