private String removeCommentedOutScripts2(String script) {
		if (script == null)
			return null;
		int beg = script.indexOf("//");
		if (beg == -1)
			return script;
		List<int[]> list = new ArrayList<int[]>();
		int end = script.indexOf("\n", beg + 2);
		int beg0 = -1;
		while (beg != -1 && end != -1) {
			list.add(new int[] { beg, end });
			beg0 = beg;
			beg = script.indexOf("//", end);
			if (beg0 == beg) // infinite loop
				break;
			end = script.indexOf("\n", beg);
		}
		if (beg != -1) {
			list.add(new int[] { beg, script.length() });
		}
		int n = list.size();
		if (n == 0)
			return script;
		int[] curr = list.get(0), prev;
		String x = script.substring(0, curr[0]);
		for (int i = 1; i < n; i++) {
			curr = list.get(i);
			prev = list.get(i - 1);
			x += script.substring(prev[1], curr[0]);
		}
		x += script.substring(curr[1]);
		return x.trim();
	}