How to import folder as list, and export list as folder

Similarly to how Pumpkinhead's project can import images, audio and other files, I want to be able to import a folder and store the items within it as a list (with the file name intact) so that I can manipulate their names and export them out of Snap! back to my computer.

@pumpkinhead If you could help me it would be much appreciated, but the same goes for anyone.

I believe there's an HTML5 API for this (basically JS), I'll write a more detailed response later
I don't think there's a way to do this without JS

I also don't think there's any way to do it without JavaScript. Help appreciated.

I looked online and it looks like there's a property for input elements named webkitdirectory. This prompts the user to select directories rather than files, and when submitted, will output each file in the directory recursively. You can modify my project's source to set that property of the input element to true.

Also I don't think my file import project is working anymore.

It is actually still working. One small thing is, broadcast blocks now need to be expanded, or you need an input variable in the grey ring, in order to not throw an error.

I have also actually put all the functions in the new(ish) snap extensions format here (link that can be loaded in snap)

Actually after reading the first line there, I apparently changed something. I don't remember what I did, but I guess I did something.

Oh. Weird.

It's not actually a bug with your code, it's a bug with snap. Running a broadcast block in a ring, with an input puts the input in the sprite input in the broadcast block, when it's hidden.

for example, this script

untitled script pic

will broadcast "test" to a sprite called "test", even though the broadcast block is not expanded.

edit: more about the broadcast bug here Can't broadcast to all in run block

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.