Clear the Cache Folders of user domain (selectively)

The following simple script will help you quickly clear the cache selectively when some application or service significantly slows down your computer.

As you can see, at the top of the script, the user sets the list of applications and servers that will be allowed to be cleared.

set cashesAllowedToDelete to {"CloudKit", "FamilyCircle", "GameKit", "GeoServices", "Google", "Maps", "PassKit", "Script Debugger", "SentryCrash", "askpermissiond", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "com.latenightsw.ScriptDebugger8", "familycircled", "io.sentry", "knowledge-agent", "org.videolan.vlc"}

set LibraryAlias to path to library folder from user domain

tell application "Finder"
	set CashesFolder to folder "Caches" of LibraryAlias
	set folderNames to name of folders of CashesFolder
end tell

set cashesToDelete to (choose from list folderNames with multiple selections allowed)
if cashesToDelete is false then return

repeat with i from 1 to (count cashesToDelete)
	set casheToDelete to item i of cashesToDelete
	if casheToDelete is in cashesAllowedToDelete then
		tell application "Finder" to delete folder casheToDelete of CashesFolder
	end if
end repeat

-- tell application "Finder" to empty trash -- optional