var num = 0;
function setup() {
createCanvas(windowWidth,windowHeight);
}
function draw() {
background(255);
ellipse(width/2,height/2,500,500);
}
function mousePressed(){
num++
// you must run in browser to save frames,
save("export" + num + ".jpg")
}
It does work if you open in browser