protected void assertCannotCreateNewScriptByName(final String name) throws Exception {

		pressNewButton();

		chooseJavaProvider();

		final SaveDialog saveDialog = waitForDialogComponent(SaveDialog.class);
		final JTextField nameField = (JTextField) getInstanceField("nameField", saveDialog);
		runSwing(() -> {
			nameField.setText(name);
			saveDialog.okCallback();
		});

		String statusText = saveDialog.getStatusText();
		boolean foundExpectedMessage = "Duplicate script name.".equals(statusText) ||
			"File already exists on disk.".equals(statusText);

		// cancel to prevent residual file creation after the test closes open dialogs
		runSwing(() -> saveDialog.cancelCallback());

		assertTrue("Did not get expected error message when attempting " +
			"to create new script.  Found: " + statusText, foundExpectedMessage);
	}
This call will:
-open the file in an editor
-update the text area and buffer fields of this test
@param file the file to open
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/script/AbstractGhidraScriptMgrPluginTest.java