Hyperlink Naming Convention
Copy link to clipboard
Copied
Hi All,
I hope following question is very simple for you.....
I want to change all the URL Hyperlink source name as like as Hyperlink destination contents.
Please refer the screenshot....
In the above screenshot I need to change "yaho" into "yahoo.com".
Kindly give solution for me.
Trying Code is below:
var myHyperlinks = app.activeDocument.hyperlinks;
for (k = 0; k < myHyperlinks.length; k++) {
var myHyperlinkText = myHyperlinks
var myTemp = app.activeDocument.hyperlinks.add(myHyperlinkText, {name: myHyperlinkText.contents})
}
}
Thanks in advance
Beginner
Copy link to clipboard
Copied
Hi,
get the ->destination -> //destinationURL of the hyperlink
set its name to it. <-hyperlinkname
set the sources name to it <_sourcename
guess your mixing up hyperlinkname with sourcename in your post
Copy link to clipboard
Copied
Hi Hans,
Thanks for your quick response....
Hyperlink concept is entirely new for me.
I am trying for a long time but I not able find the result...
Could you please provide any related coding...
Thanks
Beginner
Copy link to clipboard
Copied
sthg. like this:
someHyperlink = app.activeDocument.hyperlinks[0];
itsURLDestination = someHyperlink.destination.destinationURL; //case of being a hyperlinkURLDestination; may be not -> you've got tocheck:)
changeHyperlinkName = someHyperlink.name = itsURLDestination;
changeSourceName = someHyperlink.source.name = itsURLDestination;
Sunny day
Hans-Gerd Claßen

