save serial data to .txt file on Mac

I state that I don’t know how to use processing.
I need to save data sent via serial from Arduino to a .txt file on my mac.
Can anyone help me?

unless you expect that you get the full program here,
it does actually not matter that you use arduino / serial / and a mac hardware…

if you have a string in a processing ( array ) variable you can save it to
lines of a file using

pls note that best use like

String outfile = "data/fromArduino.txt";

void keyPressed() { // Press a key to save the data
  if ( key == 's' ) saveStrings(outfile, lines);
1 Like