Hyperlink question

Hi,

if there any way to know is some link related to text in some text frame?

If I have simple text: “This is hyperlink”, I want to know that hyperlink is on “hyperlink” word.

Thanks, Ivica.

There is TextFrame.getLinks() property. It has all the Link objects that textframe contains. The Link object has two properties Link.getBegin() and Link.getEnd(), which are indices to indicate where the link starts and where it ends inside the characters of text.

You can use them to calculate, if the word you are looking has a link on it.

Ok, but is there any way for me to know what text is at link beginning?

Thanks, Ivica.

Use it as an index to string returned by TextFrame.getText()

For example, if the string returned by TextFrame.getText() is "This is hyperlink." then Link.getBegin() will return you 7, the index where the word hyperlink starts.

Thanks, I have managed to solve my problem.

Ivica.