envygeeks
1/15/2018 - 8:13 PM

[Clean network drives of `.DS_Store`]

on idle
	tell application "Finder"
		do shell script "find ~ -name .DS_Store -mindepth 2 -delete"
		set volumesToClean to {"Backups", "Movies"}
		
		repeat with volume in volumesToClean
			if (exists disk volume) then
				set volPath to "/Volumes/" & volume
				do shell script "find " & quoted form of volPath & " -name .DS_Store -delete"
				do shell script "dot_clean " & quoted form of volPath
			end if
		end repeat
	end tell
	
	return 3600
end idle