Hi Monty,
there are two problems with your code.
first you try to set the textStyle of a variable:
Code: Select all
set the textstyle of line tLine of tData to "bold"
this does not work because only the field can have a textStyle. The variable tData is just the text, no styling.
second you use "repeat for each line tLine in tData". While this is faster than "repeat with i = 1 to the number of lines of tData" repeat for each has no idea what the number of the line is that you are looking at, it has the text of a line in variable tLine. So you either use "repeat with i = 1 to x" to know the number of the line you are looking at because "i" is the number or you would have to add a counter to the "repeat for each line tLine in tData" loop
unless your text is very long I would use something like this:
Code: Select all
on mouseUp
put URL("file:gca/annos/t"&tTitNum&".txt") into tData
put tData into field "annos" -- first put data into field
repeat with i = 1 to the number of lines of tData -- do repeat with instead of for each line to know where you are
if the last char of the first word of line i of tData is ":" then
set the textstyle of line i of field "annos" to "bold" -- now change textStyle of field
end if
end repeat
end mouseUp
There are other ways to set the textStyle of a line but they are more complicated, although probably a bit faster.
If what I am trying to say is not clear please ask.
Kind regards
Bernd