I can not get the example to work. I have tried it with & without an existing target file in the home folder. Does this have to be done on a server?
It’s supposed to prompt your web browser to open/save the file. This should work fine –
let words = 'apple bear cat dog';
function setup() {
createCanvas(100, 100);
background(200);
text('click here to save', 10, 10, 70, 80);
words = split(words, ' ');
}
function mousePressed() {
saveStrings(words, 'nouns.txt');
}
I’ve moved the split()
to the setup()
block, and simplified things by reassigning the array to words
and removing the condition in the mousePressed()
.
It still needs to read words.split("); //// NOT split(words, " ")
I get the prompt but no ‘nouns’.txt" file. Is it in my downloads folder maybe?
works for me though.
Have you checked??
I find the text file in my download folder.
This might depend on your browser (and OS), I use Firefox
C:\Users\Chrisir\Downloads