How to convert text selection into Hyperlink?
Mytext1, mytext2, mytext3.
I'd like to select mytext2 and convert it to hyperlink (like as by context menu: Hyperlink - New hyperlink from URL.)
Is it possible?
Thanks.
Mytext1, mytext2, mytext3.
I'd like to select mytext2 and convert it to hyperlink (like as by context menu: Hyperlink - New hyperlink from URL.)
Is it possible?
Thanks.
Something like the following should work, run the code with a text selection and it should create the hyperlink on it. Change the app.selection[0] to the object of the text that you might have in your actual code
var source = app.documents[0].hyperlinkTextSources.add(app.selection[0])
var dest = app.documents[0].hyperlinkURLDestinations.add("http://"+ app.selection[0].contents)
app.documents[0].hyperlinks.add(source,dest, {name:app.selection[0].contents})
-Manan
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.