Using args[] for opening files

@kfrajer

public void setup(){
/* setup code */
    
 if(args != null){
  if(args.length > 0){
  openTab(args[0]);
  }
 } 
 
  }

void openTab(String sel){
  path = sel;
 json = loadJSONObject(sel);
  Song = json.getString("Song");
  Artist = json.getString("Artist");
  Album = json.getString("Album");
  Genre = json.getString("Genre");
  Description = json.getString("Description");
  timing = json.getInt("Timing");
  compTab = json.getString("CompTab");
  measure = json.getInt("Measure");
  sldestr = Integer.parseInt(json.getString("sldestr"));
  chordOn = json.getBoolean("chordOn");
  sep = json.getString("sep");
  string[0] = json.getString("string[0]");
  string[1] = json.getString("string[1]");
  string[2] = json.getString("string[2]");
  string[3] = json.getString("string[3]");
  string[4] = json.getString("string[4]");
  string[5] = json.getString("string[5]");
  chord[0] = json.getString("chord[0]");
  chord[1] = json.getString("chord[1]");
  chord[2] = json.getString("chord[2]");
  chord[3] = json.getString("chord[3]");
  chord[4] = json.getString("chord[4]");
  chord[5] = json.getString("chord[5]");
  tuningin[0] = json.getInt("tuning[0]");
  tuningin[1] = json.getInt("tuning[1]");
  tuningin[2] = json.getInt("tuning[2]");
  tuningin[3] = json.getInt("tuning[3]");
  tuningin[4] = json.getInt("tuning[4]");
  tuningin[5] = json.getInt("tuning[5]");
  surface.setTitle("Guitar Tab Editor v" + version + " - " + path);
  str1.setSelected(tuningin[0]);
  str2.setSelected(tuningin[1]);
  str3.setSelected(tuningin[2]);
  str4.setSelected(tuningin[3]);
  str5.setSelected(tuningin[4]);
  str6.setSelected(tuningin[5]);
  beat.setText(str(timing + 1));
  meas.setText(str(measure + 1));
  sngnme.setText(Song);
  art.setText(Artist);
  alb.setText(Album);
  gnr.setText(Genre);
  descrip.setText(Description);
  updateTuning();
  updateTab();
  upmdevnt(upmd,GEvent.CLICKED);
 
}

That is the code I was using.

I wasn’t running it from the command-line, I was double clicking the file after creating the the file association the way you showed.

Another thing is that i don’t know what parameters Windows sends to the executable when you double-click a file, e.g. the filename, the path, or the filename and then the path, though this,

should resolve that.