protected String runSelectedScript(String taskName) throws Exception {
		clearConsole();

		TaskListenerFlag taskFlag = new TaskListenerFlag(taskName);
		TaskUtilities.addTrackedTaskListener(taskFlag);

		pressRunButton();
		waitForTaskEnd(taskFlag);

		String output = getConsoleText();
		clearConsole();
		return output;
	}
Run the currently selected script by pressing the run button and return its 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