String waveSubstring = waveString.substring(startIndex, endIndex + 1);
waveString = waveString.replace(waveSubstring, "\"" + getCustomSoundPathString() + chosenFile.getFileName() + "\"");
selectedFile.setUserObject(waveString);
//Write out modified tree to scriptfile.
ScriptParser parser = new ScriptParser(this.currentTreeModel);
String scriptString = getCurrentScriptString();
Path scriptPath = Paths.get(scriptString);
parser.writeModelToFile(scriptPath.toString());
//Update UI
populateSoundList();
JOptionPane.showMessageDialog(this, "Sound file successfully replaced.");