@Override
	protected void okCallback() {

		if (!editor.validateUserSelection()) {
			setStatusText("Invalid script name");
			return;
		}

		userChoice = editor.getEditorValue();

		clearStatusText();
		close();
	}
A dialog that prompts the user to select a script.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/ScriptSelectionDialog.java