Listing PNG images in source

Don't fully understand how to enumerate files properly, can you please write the simple loop (in javascript) that will list the PNG files in source to DOpus.Output.

There’s an example in the default script you get in the button editor.

Thanks found it, on the subject of enumerate function, can you tell please why this is not printing the property values (enumerating an array of objects)

DOpus.Output("**** loop start ****")
var arrayOfWords = [{brand: "Ford"}, {brand: "Renault"}, {brand: "Volkswagon"}, {brand: "Peugot"}];
var count = 0;

for (var e = new Enumerator(arrayOfWords); !e.atEnd(); e.moveNext()) {
    var item = e.brand;
    DOpus.Output(count + " ) " + item);
DOpus.Output("**** loop end ****")

output :

Change var item = e.brand;
To var item = e.item().brand;