Finding at which char a link starts and where it ends (in unlocked field)?

Malte Brill revolution at derbrill.de
Fri Mar 11 17:59:11 EST 2005


Hi list,

it´s late over here and I think I haven´t had enough coffee...
Could anyone point me to a method how to find the start char and the 
endchar of a link in an field (lockText=false)?

I have a button that will change the textStyle and linkText of the 
selectedChunk and that works ok...
What I want to do is: if the user selects a chunk that already is 
linked, change the linkText of the complete link instead of breaking it 
into pieces where the first piece has the correct link and the second 
just an <a></a> tag.

Script of the button (traversalOn=false)

on mouseUp
   put the selectedChunk into isText
   ask "Link target?" with "http://"
   put it into theHREF
   set the textStyle of isText to "link"
   set the linkText of isText to theHREF
   select isText
end mouseUp

Any ideas much appreciated.

Malte


More information about the use-livecode mailing list