private synchronized void initialize(ApplicationLayout applicationLayout, String logFile,
			boolean useLog4j) {
		/**
		 * Ensure that we are running in "headless mode"
		 */
		System.setProperty(SystemUtilities.HEADLESS_PROPERTY, Boolean.TRUE.toString());

		// Set this property to prevent static Swing-based methods from running (causes headless
		// operation to lose focus)
		System.setProperty("java.awt.headless", "true");

		/**
		 * Initialize Ghidra Runtime Environment
		 */
		initializeApplication(applicationLayout, logFile, useLog4j);

		initializeScriptPaths();
	}
Runs the specified script with the specified state.

@param scriptState  State representing environment variables that the script is able
		to access.
@param script  Script to be run.
@return  whether the script successfully completed running
Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/GhidraScriptRunner.java