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

**URL:** <https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610>\
**Category:** Coding Questions\
**Created:** [March 17, 2021, 12:51pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610 "2021-03-17T12:51:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Post date:** [March 17, 2021, 12:51pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/1 "2021-03-17T12:51:24Z")

</div>

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()`.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 17, 2021, 1:10pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/2 "2021-03-17T13:10:32Z")

</div>

> [@Is it possible to open a file with processing sketch? (command line)](https://discourse.processing.org/t/is-it-possible-to-open-a-file-with-processing-sketch-command-line/26613/9):
>
> new version //https://forum.processing.org/two/discussion/23999/detect-command-line-invocation-of-a-sketch /\*\* \* CommandLineDetect \* 2017-09-21 Jeremy Douglass - Processing 3.3.6 \* \* Related forum discussions: \* - forum.processing.org/two/discussion/23999/detect-command-line-invocation-of-a-sketch \* - forum.processing.org/two/discussion/23924/handling-command-line-arguments-in-a-sketch \* - forum.processing.org/two/discussion/6457/how-to-use-arguments-with-an-application-built-with-…

---

<div class="post-metadata">

**Author:** ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Post date:** [March 17, 2021, 4:37pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/3 "2021-03-17T16:37:59Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 17, 2021, 8:29pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/4 "2021-03-17T20:29:08Z")

</div>

are you on WIN or on mac osx?

I couldn’t run it here

---

<div class="post-metadata">

**Author:** ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Post date:** [March 17, 2021, 8:43pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/5 "2021-03-17T20:43:30Z")

</div>

I’m using processing on windows.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 17, 2021, 9:03pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/6 "2021-03-17T21:03:12Z")

</div>

I can’t help you with that

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [March 18, 2021, 10:54pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/7 "2021-03-18T22:54:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 19, 2021, 3:32pm UTC](https://discourse.processing.org/t/create-applications-to-open-a-selfmade-file-type-read-discription/28610/8 "2021-03-19T15:32:33Z")

</div>

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
