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

Indesign image count

New Here ,
Nov 23, 2017 Nov 23, 2017

Copy link to clipboard

Copied

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

Views

2.2K

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

Hi Laubender

This script is not working can you check again

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

Copy link to clipboard

Copied

I tested before posting and checked.

What is the error message you get?

Regards,
Uwe

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

LATEST

Thankyou. That works nicely. Appreciated!

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

Move this discussion to the InDesign Scripting forum.

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 17, 2018 Apr 17, 2018

Copy link to clipboard

Copied

Thanks all

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