protected ResourceFile processSaveAsDialog() {
		final String newFileName = testName.getMethodName() + System.currentTimeMillis() + ".java";
		final SaveDialog saveDialog = waitForDialogComponent(SaveDialog.class);

		final JTextField nameField = (JTextField) getInstanceField("nameField", saveDialog);
		runSwing(() -> {
			nameField.setText(newFileName);
			saveDialog.okCallback();
		});

		// after closing the dialog we have to wait for the work to finish in the Swing thread
		// that existed before the modal dialog's Swing thread.
		waitForSwing();

		ResourceFile file = saveDialog.getFile();

		assertEquals(newFileName, file.getName());
		assertTrue(file.exists());

		File realFile = file.getFile(false);
		realFile.deleteOnExit();
		return file;
	}
Run the last script by pressing the last script button and return output.

@param taskName name for the task listener
@return script output written to the console
@throws Exception on failure, e.g. timeout
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/script/AbstractGhidraScriptMgrPluginTest.java