how to set the textStyle of word 1 of the selection?

Andre.Bisseret Andre.Bisseret at inria.fr
Wed Mar 17 14:00:49 EDT 2010


Le 17 mars 10 à 13:36, BNig a écrit :

>
> Jaque,
> I like your solution a lot. I modified it a bit in case a word is  
> not fully
> selected in the first place. It would only set the textstyle to the  
> selected
> part of the word.
> -------------------------
> on mouseUp
>   select word 1 of the selection
>   if the number of words in the selection = 0 then exit mouseUp
>   put word -1 of the selectedChunk into tFieldNbr
>   put the number of words of char 1 to (word 2 of the selectedChunk)  
> of
> field tFieldNbr into tWordNbr
>   select word tWordNbr of field tFieldNbr
>   set the textstyle of the selectedChunk to "link"
> end mouseup
> -------------------------
> This way a user will have the textstyle of the word changed even if  
> he did
> not include the last letter or two in the selection. Selecting text  
> with a
> mouse can easily be one off for a lot of users.
> regards
> Bernd
> -- 
Indeed, you are right Bernd.
Thank you for scirpting such a  wise precaution

Best regards

André




More information about the use-livecode mailing list