private void updateAvailableScriptFilesForAllPaths() {

		ensureScriptsLoaded();

		List<ResourceFile> scriptsToRemove = tableModel.getScripts();
		List<ResourceFile> scriptFiles = scriptList.getScriptFiles();
		scriptsToRemove.removeAll(scriptFiles);

		for (ResourceFile scriptFile : scriptFiles) {
			ScriptInfo info = infoManager.getScriptInfo(scriptFile);
			String[] categoryPath = info.getCategory();
			scriptRoot.insert(categoryPath);
		}

		// note: do this after the loop to prevent a flurry of table model update events
		// script info was created in updateAvailableScriptfilesForDirectory
		tableModel.insertScripts(scriptFiles);

		for (ResourceFile file : scriptsToRemove) {
			removeScript(file);
			infoManager.removeMetadata(file);
		}

		infoManager.refreshDuplicates();
		refreshScriptData();
	}
refresh the list of scripts by listing files in each script directory.

Note: this method can be used off the swing event thread.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/GhidraScriptComponentProvider.java