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

How to use data merge with hyperlinks?

New Here ,
Jan 30, 2015 Jan 30, 2015

There are plenty of post out there about this but in all of my searches I have yet to find a solution which works.

This is my current script:

<<Start Script>>

app.findGrepPreferences = app.changeGrepPreferences = null;

doc = app.activeDocument;

app.findGrepPreferences.findWhat = "(?<=11).*?(?=11)";

var lnks = doc.findGrep();

app.findGrepPreferences.findWhat = "(?<=00).*?(?=00)";

var txts = doc.findGrep();

for (var i = 0; i < lnks.length; i++) {

  var urld = doc.hyperlinkURLDestinations.add(lnks.contents);

  doc.hyperlinks.add(doc.hyperlinkTextSources.add(txts), urld);

}

alert('Processed '+txts.length+' hyperlinks');

<<End Script>>

I receive an error "the object is already being used by another hyperlink."

Thank you.

TOPICS
Scripting
255
Translate
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
Community Expert ,
Jan 31, 2015 Jan 31, 2015
LATEST

Moved to the InDesign Scripting forum...

Translate
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