Copy link to clipboard
Copied
Does anyone know how I can save out/export a text file list of all the links in my inDesign file please?
Cheers.
Choose File>Package, click Report, then Cancel. The saved text file will list links and link info.
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
Hello,
If you're on a Mac check out the link below....
https://indesignsecrets.com/create-a-list-of-linked-files.php
Regards,
Mike
Copy link to clipboard
Copied
Choose File>Package, click Report, then Cancel. The saved text file will list links and link info.
Copy link to clipboard
Copied
Good stuff.
Thank you Rob.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Nice one!
Both ways work – both have pros and cons.
But this is great help.
Thank you.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hello, could you please make modification of yours script so it would use one report log file for multiple documents.
For example log can be placed at fixed location as root of C (C:\links_log.txt)
Script should make one line name of the file and than list of links followed by separation of few dashes.
Is this very complicated to be done?
Copy link to clipboard
Copied
Hi Mike,
thank you for such a great script! It works fine.
I need also the page number of the image on the list.
Is that possible ?
Best regards
Copy link to clipboard
Copied
This code works great!
Do you know if it's possible to get the entire path? I'm not seeing anything on how to do it in the documentation.
Copy link to clipboard
Copied
Give this a try...
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].filePath);
}
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
Copy link to clipboard
Copied
Yes! That works great! Thanks for the help, I was really stumped on this one!
Copy link to clipboard
Copied
Hello,
If you're on a Mac check out the link below....
https://indesignsecrets.com/create-a-list-of-linked-files.php
Regards,
Mike
Copy link to clipboard
Copied
Thank you Mike.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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;
}
}
Copy link to clipboard
Copied
This will make CSV (among a few formats). Open in a spreadsheet and sort however you like.
http://www.marspremedia.com/software/indesign/links-report