How can i add a "Open with" function?

Hello @Aryszin,

This no-frills Processing sketch will open a text file with “notepad.exe” on Windows 10.

Code:

String skPath;
String txtFileName;

void setup() 
  {
  size(200, 200);
  }

void draw() 
  {
  // draw() must be present for mousePressed() to work
  String txtFile[] = {"Example text file",
                       " Short and sweet."
                      };
  skPath = sketchPath("");
  txtFileName = "text.txt";
  saveStrings(txtFileName, txtFile);              
  }

void mousePressed() {
  println("Opening Process_4");
  launch("notepad.exe" + " " + skPath + txtFileName);
}

The above is my initial interpretation of your post without the "open with app” dialog.

References:

:)