Skip to main content
bagonterman
Inspiring
August 16, 2012
Question

count files in a folder

  • August 16, 2012
  • 1 reply
  • 1815 views

I want to count the files in a volume. This will tell me how many pictures that i have then as certain actions happen it will automatically add them up for me. First step is finding the corect syntax for the items.

This topic has been closed for replies.

1 reply

bagonterman
Inspiring
August 16, 2012

OK. This is what I am looking for

app.document.thumbnail.children

now I just have to count these little children.

Paul Riggott
Inspiring
August 16, 2012

alert(app.document.thumbnail.children.length);

bagonterman
Inspiring
August 16, 2012

I ended up using this but I am sure its the same thing.

var myItems =app.document.thumbnail.children;

     for (var i=0; i<myItems.length; i++){}

         alert(i-2);

I am slowly plucking away at this calculator thing.

I am subtracting two because I have two pdf files I don't want to count.

Yep just tried it. It works.