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

Indesign image count

New Here ,
Nov 23, 2017 Nov 23, 2017

Hi All,

Please help me I have lot of indesign files and I have check all pages images count so if you can help me a developed a java script so my work is so easy for example 2 page we have used 20 images script crated a page no and give me how many image i have used.

TOPICS
Scripting
2.7K
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 ,
Nov 23, 2017 Nov 23, 2017

Hi,

read out the length of the allGraphics array of a page.

Loop all pages of a document.

var doc = app.documents[0];

var allGraphicsPerPages = doc.pages.everyItem().allGraphics;

var result = [doc.name];

result[1] = [ "Page Name" +" : "+ "Number of Graphics on Page" ];

for(var n=0;n<allGraphicsPerPages.length;n++)

{

    result[n+2] = doc.pages.name +" : "+allGraphicsPerPages.length;

};

$.writeln(result.join("\r"));

The result is written to the JavaScript Console of the ESTK (ExtendScript Toolkit) where you can copy the text.

Script is working on the active document.

Regards,
Uwe

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
New Here ,
Nov 24, 2017 Nov 24, 2017

Hi Laubender

This script is not working can you check again

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 ,
Nov 24, 2017 Nov 24, 2017

I tested before posting and checked.

What is the error message you get?

Regards,
Uwe

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 ,
Nov 24, 2017 Nov 24, 2017

You need to copy all the code to a text-only, unformatted text document and save it with a .jsx suffix.

In case you see line numbering in the code you copied:
Do not copy the code from mail, come to the forum and copy the code directly from the post.

Then install it so that it is available in the InDesign Scripts panel.
Details on installing: Indiscripts :: Indiscripts for Dummies

Regards,
Uwe

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
Explorer ,
Sep 15, 2018 Sep 15, 2018

Hello

I've managed to apply the script and it works. However, I can't see a way to add up a final figure for the total number of images in the document. What piece of code would I need to add to be able to see the total rather than per page?

Thanks

Pete

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 ,
Sep 15, 2018 Sep 15, 2018

var doc = app.documents[0]; 

var result = [ "Doc Name" +" : "+ "Total Number of Graphics on Doc" ]; 

result[1] = doc.name + " : " + doc.allGraphics.length

$.writeln(result.join("\r"));

I think the above code is what you need.

-Manan

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
Explorer ,
Sep 15, 2018 Sep 15, 2018
LATEST

Thankyou. That works nicely. Appreciated!

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
New Here ,
Nov 24, 2017 Nov 24, 2017

var doc = app.documents[0];  is not an object  they are pass an error show me

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 ,
Nov 24, 2017 Nov 24, 2017

Move this discussion 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
New Here ,
Apr 17, 2018 Apr 17, 2018

Thanks all

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