• Easy way to save strings to file system are using saveStrings() and saveStream().
  • saveStrings() a list into a target file
  • String names = "thej raj simran me";
    String[] nameslist = split(names, ' ');
    saveStrings("names.txt", nameslist);
  • You can allow user to select a target file using selectOutput()
  • String names = "thej raj simran me";
    String[] nameslist = split(names, ' ');
    String savePath = selectOutput("Please select a file to save the names ");
    saveStrings(savePath, nameslist);
  • beginRecord() and endRecord() can be used to continuously write to the file system what is written to the screen.
    import processing.pdf.*;
    
    void setup() {
      size(400, 400);
      beginRecord(PDF, "drawings.pdf");
    }
    
    void draw() {
      ellipse(mouseX, mouseY, 10, 10);
    }
    
    void mousePressed() {
      endRecord();
      exit();
    }