如何选择带有特殊字符的单词(例如:usa-uk)。下面的代码将选择文本,但不会选择像usa-uk这样的单词。我如何更改我的代码如何在LIvecode中选择带有特殊字符的单词
select the mouseText
如何选择带有特殊字符的单词(例如:usa-uk)。下面的代码将选择文本,但不会选择像usa-uk这样的单词。我如何更改我的代码如何在LIvecode中选择带有特殊字符的单词
select the mouseText
如果你没有在你的领域一个巨大的文字您可以使用:
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
你怎么选择?例如,如果这是在该领域的脚本:
on mousemove select the mouseText end mouse move
你会选择光标下的文本。为了选择复合文本,例如“usa-uk”,您必须对该文本片段进行分组。这将该片段的textStyle设置为“链接”。
克雷格·纽曼