listContents limited to 8 entries

Hello everyone,

I’m currently experimenting with Drafts scripts. I wrote a script which reads the file names of all files in a folder. Afterwards the path and file extension is deleted from the string and the file names are put in a promt to select from.

Everything is basically working up until I hit 9 files in the folder. For some reason listContents does only show 8 files. If i remove one then it shows the 8 remaining. I could find nothing explaining this behaviour in the documentation or forums so far. Anyone else has experienced the same issue?

The code that generates the list is as follows


// Create cloud object
var fmCloud = FileManager.createCloud(); // iCloud
var header_list = fmCloud.listContents("./note_vault/Header Files");

var p=Prompt.create();
p.message = header_list ;;


Thanks for your help :slight_smile:

I ran your code, but changed it to refer a folder I have with lots of files and I got more than 8.

Have you tried a different folder?

I’m wondering if there is something unusual about one of your file names that is causing an issue.

I am confused. I swear I tried it out all night yesterday. Ran it again a second ago. Didn’t work. Then I deleted the folder and remade it with different files. Now it is working. I recopied the original 9 files. They are working too.

My problem is solved I guess. A bit unsatisfying but I am not complaining :slight_smile: Thanks for your time and help.