• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hyperlink Naming Convention

Enthusiast ,
Jun 13, 2013 Jun 13, 2013

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....

Hyperlink_naming.png

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.source.sourceText.contents

     var myTemp = app.activeDocument.hyperlinks.add(myHyperlinkText, {name: myHyperlinkText.contents})

    }

    }

Thanks in advance

Beginner

TOPICS
Scripting

Views

773

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 13, 2013 Jun 13, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 14, 2013 Jun 14, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 14, 2013 Jun 14, 2013

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines