public DomainFolder askProjectFolder(final String title) throws CancelledException {

		DomainFolder existingValue = loadAskValue(this::parseProjectFolder, title);
		if (isRunningHeadless()) {
			return existingValue;
		}

		DomainFolder choice = doAsk(Program.class, title, "", existingValue, lastValue -> {

			DataTreeDialog dtd = new DataTreeDialog(null, title, CHOOSE_FOLDER);
			dtd.show();
			if (dtd.wasCancelled()) {
				throw new CancelledException();
			}

			return dtd.getDomainFolder();
		});

		return choice;
	}
Returns a DomainFolder object, using the supplied title string for guidance.  The actual
behavior of the method depends on your environment, which can be GUI or headless.
<p>
Regardless of environment -- if script arguments have been set, this method will use the
next argument in the array and advance the array index so the next call to an ask method
will get the next argument.  If there are no script arguments and a .properties file
sharing the same base name as the Ghidra Script exists (i.e., Script1.properties for
Script1.java), then this method will then look there for the String value to return.
The method will look in the .properties file by searching for a property name that is the
title String parameter.  If that property name exists and its value represents a valid
project folder, then the .properties value will be used in the following way:
<ol>
		<li>In the GUI environment, this method displays a file chooser dialog that allows the
			user to select a project folder. The selected folder will be returned.</li>
		<li>In the headless environment, if a .properties file sharing the same base name as the
			Ghidra Script exists (i.e., Script1.properties for Script1.java), then this method
			looks there for the name of the project folder to return. The method will look in
			the .properties	file by searching for a property name equal to the 'title' parameter.
			If that property name exists and its value represents a valid DomainFolder in the
			project, then that value is returned. Otherwise, an Exception is thrown if there is
			an invalid or missing .properties value.</li>
</ol>

@param title the title of the dialog (GUI) or the variable name	(headless or when
			using .properties file)
@return the selected project folder or null if there was an invalid .properties value
@throws CancelledException if the user hit the 'cancel' button in GUI mode
@throws IllegalArgumentException if in headless mode, there was a missing or invalid	project
			folder specified in the .properties file
Ghidra/Features/Base/src/main/java/ghidra/app/script/GhidraScript.java