1

I would like to select all files in images folder, instead of listing them one by one

        function initPage() {
            var pairsGame = new PairsGame({
                containerId: 'playfield',
                cardWidth: 200,
                cardHeight: 150,
                cols: 4,
                rows: 3,
                imageBase: 'images/',
                images: ['abendwolken.jpg','herd.jpg','muellkatze.jpg',
                    'ich_in_berlin.jpg','schaedel.jpg','sonnenblume.jpg',
                    'duenenbier.jpg','igel.jpg','schlafkatze.jpg',
                    'sunset.jpg']
user3375733
  • 61
  • 1
  • 11

2 Answers2

2

unless you're using node or something similar JS does not generally have access the filesystem.

however there are some exceptions... The HTML5 FileAPI for example http://www.html5rocks.com/en/tutorials/file/dndfiles/

0
 var inputFolder = Folder.selectDialog( "Please select top level folder to process"); 
    var fileList = inputFolder.getFiles();

    for(i=0;i<fileList.length;i++) var docRef = app.open(fileRef);
Wanna Coffee
  • 2,742
  • 7
  • 40
  • 66
Deepak Sharma
  • 223
  • 2
  • 3