if (key != null)
newScripts = ScriptEnumerator.getScripts(ctx, key);
if (newScripts == null || newScripts.size() == 0) {
// if no scripts were found, create an appropriate default entry.
newScripts = new ArrayList<ScriptID>();
ScriptID defaultScript = createDefaultScript(key);
newScripts.add(defaultScript);
newScripts.add(defaultScript);
}
ScriptID defaultScript = newScripts.get(0);
String dataPath = defaultScript.getDataPath();
for (int i = 1; i < newScripts.size(); i++) {
ScriptID script = newScripts.get(i);
if (dataPath != null && !dataPath.equals(script.getDataPath()))
break;
scripts.addElement(script);
dataPath = script.getDataPath();
if (defaultScript.scriptEquals(script))
scriptList.getSelectionModel().setLeadSelectionIndex(i - 1);
}
if (Settings.getBool("userPref.teamScripts.useWipe", true))