Skip to main content
Known Participant
March 17, 2020
Answered

How to export a list of links from indesign cc 2020

  • March 17, 2020
  • 4 replies
  • 14688 views

Does anyone know how I can save out/export a text file list of all the links in my inDesign file please?

Cheers.

Correct answer Mike Bro

Hello,

If you're on a Mac check out the link below....

 

https://indesignsecrets.com/create-a-list-of-linked-files.php

 

Regards,

Mike

4 replies

eriks3
Participating Frequently
August 5, 2022

Is it possible to export a list of every link in the order they appear in the document? Or alphabetical? This would be very useful for a back of book catalog. 

rob day
Community Expert
Community Expert
August 5, 2022

Hi @eriks3 , You could add a sorting function to @Mike Bro ’s script—this would be alphanumeric:

 

doc = app.activeDocument;
myDocFolder = app.activeDocument.filePath;
var fileName = doc.name.replace(/.indd/, "");
var linkNames = fileName + '_Links-list.txt';

var file = new File(myDocFolder.fsName + "/" + linkNames);

var myLinkName = new Array();
myLinks = app.activeDocument.links;
for(var i=0; i < myLinks.length; i++){
    myLinkName.push(myLinks[i].name);
}
myLinkName.sort(sortAlphaNum);

var mylist = myLinkName;
var myNewlist = (String(mylist).replace(/,/g, '\r'));


file.encoding = 'UTF-8';
file.open('w');
file.write(myNewlist);
file.close();
alert('Done creating links list!');


function sortAlphaNum(a, b) {
    var reA = /[^a-zA-Z]/g;
    var reN = /[^0-9]/g;
    var aA = a.replace(reA, "");
    var bA = b.replace(reA, "");
    if (aA === bA) {
        var aN = parseInt(a.replace(reN, ""), 10);
        var bN = parseInt(b.replace(reN, ""), 10);
        return aN === bN ? 0 : aN > bN ? 1 : -1;
    } else {
        return aA > bA ? 1 : -1;
    }
}
Mike BroCorrect answer
Legend
March 17, 2020

Hello,

If you're on a Mac check out the link below....

 

https://indesignsecrets.com/create-a-list-of-linked-files.php

 

Regards,

Mike

Known Participant
March 18, 2020

Thank you Mike.

Community Expert
March 17, 2020

Select the links in the links panel and the in the flyout menu(accessed by clicking the 3 horizontal lines on the top right of panel), select Copy Info and then Copy Info for selected links. Then you can paste the info in a text file

 

-Manan

-Manan
Known Participant
March 17, 2020

Nice one!

Both ways work – both have pros and cons.

But this is great help.

 

Thank you.

Legend
March 18, 2020

Hello,

Try the .jsx version for your needs.

 

doc = app.activeDocument;
myDocFolder = app.activeDocument.filePath;
var fileName = doc.name.replace(/.indd/, "");
var linkNames = fileName + '_Links-list.txt';

var file = new File(myDocFolder.fsName + "/" + linkNames);

var myLinkName = new Array();
myLinks = app.activeDocument.links;
for(var i=0; i < myLinks.length; i++){
myLinkName.push(myLinks[i].name);
}

var mylist = myLinkName;
var myNewlist = (String(mylist).replace(/,/g, '\r'));

file.encoding = 'UTF-8';
file.open('w');
file.write(myNewlist);
file.close();
alert('Done creating links list!');

Regards,

Mike

 

rob day
Community Expert
Community Expert
March 17, 2020

Choose File>Package, click Report, then Cancel. The saved text file will list links and link info.

 

Known Participant
March 17, 2020

Good stuff.

Thank you Rob.