2015-06-22 1 views

ответ

0

Если вы не имеете огромный текст в поле, которое вы могли бы использовать:

on mouseMove 
    if the mouseLoc is within the rect of me then 
     put the mouseChunk into tChunk 
     # Check if chars before or after is a "spacing char" 
     put word 2 of tChunk into tstart 
     put word 4 of tChunk into tEnd 
     repeat with i = tStart down to 1 step -1 
     if matchText(char i of me, "\s") then exit repeat 
     end repeat 
     put i+1 into tStart 
     repeat with i = tEnd to the number of chars of me 
     if matchText(char i of me, "\s") then exit repeat 
     end repeat 
     put i-1 into tEnd 
     select char tstart to tEnd of me 
    end if 
end mouseMove 
0

Как вы выбираете? Например, если это было в сценарии поле:

on mousemove select the mouseText end mouse move

Вы бы выбрать текст под курсором. Чтобы выбрать сложный текст, например «usa-uk», вам придется сгруппировать этот фрагмент текста. Это устанавливает textStyle этого фрагмента для «ссылки».

Craig Newman

Смежные вопросы