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']

2 Answers 2

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/

Sign up to request clarification or add additional context in comments.

Comments

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);

1 Comment

Provide some explanation, so that future user can understand easily.!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.