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.
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
Copy link to clipboard
Copied
Hi Laubender
This script is not working can you check again
Copy link to clipboard
Copied
I tested before posting and checked.
What is the error message you get?
Regards,
Uwe
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
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
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
Copy link to clipboard
Copied
Thankyou. That works nicely. Appreciated!
Copy link to clipboard
Copied
var doc = app.documents[0]; is not an object they are pass an error show me
Copy link to clipboard
Copied
Move this discussion to the InDesign Scripting forum.
Copy link to clipboard
Copied
Thanks all