Loading...
Logo
Processing Forum
Hello,

I wrote a sketch witch use specifics files to save informations.
this sketch is exported (.exe).
those file are saved with .pod extention.
I want to open my sketch by double clik on ".pod" files in order to use data saved in it.

Today i succeded to open my sketch when i double click on pod file but i didn't succed to import in my sketch the name of tis file.

I saw param() function but it works only in brownser.

Is anybody know how can i use in my skecth the ".pod" file name ?

I hope my problem is clear ...if not tell me and i try to explain different way.

Replies(2)

Thank you,

I didn't really understand how it works...
but i found a way to do it:

i use a small batch program in order to create a file with the parameters so i can read those parameters with my main sketch.

the main program (Essai.exe) :
Copy code
  1. try { 
    Runtime.getRuntime().exec("cmd.exe /c assoc pod=Podopressioscope");
    Runtime.getRuntime().exec("cmd.exe /c ftype Podopressioscope=D:...datalanceProg.bat %1 %2 %3" );              //this in order to open my batch when double click on ".pod" file
    }
    catch (Exception e) {println(e); }

    File passParam=new File("D:...datapassParam.txt");
    if (passParam.exists()){
     
    String nomFichier[] =loadStrings(passParam);            //load param witch ahve been wroten in passParam.txt
    stroke(0);


    for (int num=0;num<nomFichier.length;num++)
      text(nomFichier[num],0,0,100,200);                  //text the params but you can use it
      
      
      
      
    passParam.delete();   //delete passParam.txt for next time




here the lanceProg.bat file
Copy code

  1. echo %*>>D:jmlDocumentsProcessingessaiapplication.windowsdatapassParam.txt      //write param in the file
    cd D:jmlDocumentsProcessingessaiapplication.windows
    if exist D:jmlDocumentsProcessingessaiapplication.windowsdatapassParam.txt Essai.exe           //open my main program

It works well
the last problem is that if double click on more than one .pod file my main program is open for each .pod file
i don't know how to check if the skecth is already running in order to prevent new opening...

mayby someone can help..