Create applications to open a selfmade file type (read discription)

I created a programm to process a specific file format.
How can I make it compartible with the “open with”-function when double-clicking the file?
In the programm the files are opened with selectedInput().

1 Like

If I get it right you can pass down things like the filepath into the args array.
I tried out something like this:

if(args!=null) read(new File(args[0])) else selectInput("open:","read"); 

It doesn’t work with opening the file. Also I tried and failed to open the file using
start “Path/Programm.exe” “Path/File.filetype”

Could you help with that please?

are you on WIN or on mac osx?

I couldn’t run it here

I’m using processing on windows.

I can’t help you with that

Does launch not work with unknown file types. Also am i correct you just want processing to act as a file picker or are you looking to read the data in the file. Providing windows is set up to open the file with your program of choice then launch should work and if you just need the data might be worth looking at buffered stream which in this case would make it a java question as opposed to a processing question.

Alternatively you could convert your file to a txt file or any other type that processing can handle such as csv byte etc.

I think it’s about

  • exporting the Sketch as an exe under Windows
  • being able to drag a file A (e.g. txt-file) onto the exe-file
  • or use the right-click local menu of file A to send the path of A to the exe-file
  • exe-file must be able to read the args and load a file specified therein

I tried but it didn’t work:

  • the exe-file was running on its own.
  • As soon as I dragged a file A onto it it wasn’t starting anymore

Chrisir