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

Find unwanted duplicate photos

New Here ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

Hi all,

I produce books with indesign that often have hundreds of pages and even more images.
It happens that I accidentally use the same image twice.
I am looking for a way to search my links to see if there are unwanted duplicates.
Any ideas, scripts which might help?

TOPICS
How to , Scripting

Views

320

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

correct answers 2 Correct answers

Community Expert , Apr 24, 2023 Apr 24, 2023

Look into the link panel, any image that is used multiple times is grouped and shown that is used multiple times.

Votes

Translate

Translate
Community Expert , Apr 24, 2023 Apr 24, 2023

This is a bit crude - just trying to see if it works for you

It will create a text file on your desktop listing the images that are duplicated and what pages they are on

 

var allLinks = app.activeDocument.links;

var imageLinks = {};

for (var i = 0; i < allLinks.length; i++) {
  var linkName = allLinks[i].name;
  var parentObj = allLinks[i].parent;
  var pageNum = parentObj.parentPage.name;
  if (!imageLinks[linkName]) {
    imageLinks[linkName] = [pageNum];
  } else {
    imageLinks[linkName]
...

Votes

Translate

Translate
Community Expert ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

Look into the link panel, any image that is used multiple times is grouped and shown that is used multiple times.

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
New Here ,
Apr 25, 2023 Apr 25, 2023

Copy link to clipboard

Copied

LATEST

Thanks much!

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
Community Expert ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

This is a bit crude - just trying to see if it works for you

It will create a text file on your desktop listing the images that are duplicated and what pages they are on

 

var allLinks = app.activeDocument.links;

var imageLinks = {};

for (var i = 0; i < allLinks.length; i++) {
  var linkName = allLinks[i].name;
  var parentObj = allLinks[i].parent;
  var pageNum = parentObj.parentPage.name;
  if (!imageLinks[linkName]) {
    imageLinks[linkName] = [pageNum];
  } else {
    imageLinks[linkName].push(pageNum);
  }
}


var file = new File("~/Desktop/image_links.txt");


file.open("w");

for (var linkName in imageLinks) {
  if (imageLinks[linkName].length > 1) {
    file.writeln(linkName + ': Pages ' + imageLinks[linkName].join(', '));
  } else {
    file.writeln(linkName);
  }
}

file.close();

alert('Image links have been saved to the file "image_links.txt" on your desktop.');

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
New Here ,
Apr 25, 2023 Apr 25, 2023

Copy link to clipboard

Copied

Thanks much!

 

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