Copy link to clipboard
Copied
If the cursor happens to be located inside a hyperlink text source, the hyperlinks panel reveals which hyperlink is involved. If a run of text is selected, the hyperlinks panel reveals which hyperlink text sources the selected text overlaps (none, one, or many).
I can't figure out how to do this with JavaScript. Any suggestions?
Thanks in advance!
1 Correct answer
Hi @Jeremy bowmangraphics, I believe you can use the findHyperlinks method of the text. For example:
var myHyperlinks = app.activeDocument.selection[0].findHyperlinks();
alert(myHyperlinks.length);
- Mark
Copy link to clipboard
Copied
Hi @Jeremy bowmangraphics, I believe you can use the findHyperlinks method of the text. For example:
var myHyperlinks = app.activeDocument.selection[0].findHyperlinks();
alert(myHyperlinks.length);
- Mark
Copy link to clipboard
Copied
That's exactly what I was looking for, and now my script is working perfectly, thanks very much!
Copy link to clipboard
Copied
Awesome! Good work. 🙂

