Getting all file type in one go is full of danger!
Code:
var myFolder = Folder("~/desktop");
var fileList = myFolder.getFiles();
alert(fileList.length);
This will get you a list of all file and folders plus hidden files executables etc. etc
This is why getting all files is not a good idea.
this is much better as it will get a list of known photoshop files..
Code:
var myFolder = Folder("~/desktop");
var fileList = myFolder.getFiles(/\.(jpg|jpe|jpeg|gif|eps|dng|bmp|tif|tiff|psd|crw|cr2|rle|dib|cin|dpx|ps|pcd|pict|vda|icb|vst|wbm|sct|pbm|flm|psb|exr|pcx|pdp|nef|dcr|dc2|erf|raf|orf|tga|mrw|mos|srf|pic|pct|pxr|pdd|pef|png|x3f|raw)$/i);
alert(fileList.length);
Sorry I don't do anything with Indesign so can't help with that.