public void saveChangedPrograms() {
		int saveCnt = 0;
		int unsavedCnt = 0;
		Program[] programs = programMgr.getAllOpenPrograms();
		for (Program program : programs) {
			if (program.isChanged()) {
				if (program.canSave()) {
					save(program);
					++saveCnt;
				}
				else {
					++unsavedCnt;
				}
			}
		}
		if (saveCnt != 0) {
			Msg.showInfo(getClass(), tool.getToolFrame(), "Save All...",
				"Saved " + saveCnt + " modified programs.");
		}
		if (unsavedCnt != 0) {
			Msg.showWarn(getClass(), tool.getToolFrame(), "Save All...",
				"Unable to save " + unsavedCnt + " read-only programs!");
		}
	}
Saves all programs that have changes
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/ProgramSaveManager.java